rt: Don't ignore result of chdir. Fail hard for now with a FIXME

My gcc won't let the result of this function be ignored.
This commit is contained in:
Brian Anderson 2012-02-07 20:28:57 -08:00
parent 6cf40bd0c4
commit 9b01620e8d

View file

@ -153,7 +153,11 @@ rust_run_program(const char* argv[],
if (err_fd) dup2(err_fd, 2);
/* Close all other fds. */
for (int fd = getdtablesize() - 1; fd >= 3; fd--) close(fd);
if (dir) { chdir(dir); }
if (dir) {
int result = chdir(dir);
// FIXME: need error handling
assert(!result && "chdir failed");
}
#ifdef __APPLE__
if (envp) {