Skip to content

Commit 9b01620

Browse files
committed
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.
1 parent 6cf40bd commit 9b01620

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/rt/rust_run_program.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,11 @@ rust_run_program(const char* argv[],
153153
if (err_fd) dup2(err_fd, 2);
154154
/* Close all other fds. */
155155
for (int fd = getdtablesize() - 1; fd >= 3; fd--) close(fd);
156-
if (dir) { chdir(dir); }
156+
if (dir) {
157+
int result = chdir(dir);
158+
// FIXME: need error handling
159+
assert(!result && "chdir failed");
160+
}
157161

158162
#ifdef __APPLE__
159163
if (envp) {

0 commit comments

Comments
 (0)