Skip to content
Merged
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
5 changes: 3 additions & 2 deletions src/libstd/sys/redox/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub struct DirEntry {
name: Box<[u8]>
}

#[derive(Clone)]
#[derive(Clone, Debug)]
pub struct OpenOptions {
// generic
read: bool,
Expand All @@ -63,6 +63,7 @@ pub struct FilePermissions { mode: u16 }
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
pub struct FileType { mode: u16 }

#[derive(Debug)]
pub struct DirBuilder { mode: u16 }

impl FileAttr {
Expand Down Expand Up @@ -336,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