Skip to content

rt: Fix compilation error with modern GCC/glibc. #1780

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/rt/rust_run_program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,13 @@ 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) {
/* FIXME: Hack to get around GCC 4.6 warnings: chdir is marked __attribute__((warn_unused_result))
Realistically it's in good faith; this should be checked for failure.
*/
int _chdir_res __attribute__((unused));
_chdir_res = chdir(dir);
}

#ifdef __APPLE__
if (envp) {
Expand Down