Skip to content

Commit 9f9489b

Browse files
committed
Cloexec when creating directories
1 parent a0a600f commit 9f9489b

File tree

1 file changed

+1
-1
lines changed
  • src/libstd/sys/redox

1 file changed

+1
-1
lines changed

src/libstd/sys/redox/fs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ impl DirBuilder {
337337
}
338338

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

0 commit comments

Comments
 (0)