We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b400005 commit 8c277d8Copy full SHA for 8c277d8
src/libstd/sys/redox/process.rs
@@ -318,7 +318,7 @@ impl Command {
318
};
319
320
let fd = if let Some(program) = program {
321
- t!(cvt(syscall::open(program.as_os_str().as_bytes(), syscall::O_RDONLY)))
+ t!(cvt(syscall::open(program.as_os_str().as_bytes(), syscall::O_RDONLY | syscall::O_CLOEXEC)))
322
} else {
323
return io::Error::from_raw_os_error(syscall::ENOENT);
324
@@ -341,6 +341,7 @@ impl Command {
341
}
342
343
if let Err(err) = syscall::fexec(fd, &args, &vars) {
344
+ let _ = syscall::close(fd);
345
io::Error::from_raw_os_error(err.errno as i32)
346
347
panic!("return from exec without err");
0 commit comments