Skip to content

Commit

Permalink
Cloexec when creating directories
Browse files Browse the repository at this point in the history
  • Loading branch information
jackpot51 committed Dec 23, 2016
1 parent a0a600f commit 9f9489b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libstd/sys/redox/fs.rs
Expand Up @@ -337,7 +337,7 @@ impl DirBuilder {
}

pub fn mkdir(&self, p: &Path) -> io::Result<()> {
let flags = syscall::O_CREAT | syscall::O_DIRECTORY | syscall::O_EXCL;
let flags = syscall::O_CREAT | syscall::O_CLOEXEC | syscall::O_DIRECTORY | syscall::O_EXCL;
let fd = cvt(syscall::open(p.to_str().unwrap(), flags | (self.mode as usize & 0o777)))?;
let _ = syscall::close(fd);
Ok(())
Expand Down

0 comments on commit 9f9489b

Please sign in to comment.