From 9b01620e8d427275217f413c770c79d2d70fac6c Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Tue, 7 Feb 2012 20:28:57 -0800 Subject: 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. --- src/rt/rust_run_program.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/rt/rust_run_program.cpp') diff --git a/src/rt/rust_run_program.cpp b/src/rt/rust_run_program.cpp index 848b015dd6c..a1a9e8d6189 100644 --- a/src/rt/rust_run_program.cpp +++ b/src/rt/rust_run_program.cpp @@ -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) { -- cgit 1.4.1-3-g733a5