Skip to content

Commit

Permalink
Auto merge of rust-lang#38577 - redox-os:master, r=alexcrichton
Browse files Browse the repository at this point in the history
Add Debug to OpenOptions and DirBuilder

This fixes the build on Redox as the platform independent structs now implement Debug.
  • Loading branch information
bors committed Dec 27, 2016
2 parents d849b13 + 9f9489b commit 86896ba
Showing 1 changed file with 3 additions and 2 deletions.
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

0 comments on commit 86896ba

Please sign in to comment.