about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-12-27 14:15:29 +0000
committerbors <bors@rust-lang.org>2016-12-27 14:15:29 +0000
commit86896ba0be624a9c09a07cc816bd972e032e4bc8 (patch)
tree04fa4e64a164f39ed51f584521e50d86fd25fa5b /src/libstd/sys
parentd849b132672d4c7824045e4458693997a424994b (diff)
parent9f9489b976b137cbff65b11f4e0a55199c4a1970 (diff)
downloadrust-86896ba0be624a9c09a07cc816bd972e032e4bc8.tar.gz
rust-86896ba0be624a9c09a07cc816bd972e032e4bc8.zip
Auto merge of #38577 - redox-os:master, r=alexcrichton
Add Debug to OpenOptions and DirBuilder

This fixes the build on Redox as the platform independent structs now implement Debug.
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/redox/fs.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libstd/sys/redox/fs.rs b/src/libstd/sys/redox/fs.rs
index e3bd77f4009..a8391d2b898 100644
--- a/src/libstd/sys/redox/fs.rs
+++ b/src/libstd/sys/redox/fs.rs
@@ -43,7 +43,7 @@ pub struct DirEntry {
     name: Box<[u8]>
 }
 
-#[derive(Clone)]
+#[derive(Clone, Debug)]
 pub struct OpenOptions {
     // generic
     read: bool,
@@ -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 {
@@ -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(())