about summary refs log tree commit diff
path: root/src/rt/rust_run_program.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rt/rust_run_program.cpp')
-rw-r--r--src/rt/rust_run_program.cpp6
1 files changed, 5 insertions, 1 deletions
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) {