Skip to content

Commit 86896ba

Browse files
committed
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.
2 parents d849b13 + 9f9489b commit 86896ba

File tree

1 file changed

+3
-2
lines changed
  • src/libstd/sys/redox

1 file changed

+3
-2
lines changed

src/libstd/sys/redox/fs.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub struct DirEntry {
4343
name: Box<[u8]>
4444
}
4545

46-
#[derive(Clone)]
46+
#[derive(Clone, Debug)]
4747
pub struct OpenOptions {
4848
// generic
4949
read: bool,
@@ -63,6 +63,7 @@ pub struct FilePermissions { mode: u16 }
6363
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
6464
pub struct FileType { mode: u16 }
6565

66+
#[derive(Debug)]
6667
pub struct DirBuilder { mode: u16 }
6768

6869
impl FileAttr {
@@ -336,7 +337,7 @@ impl DirBuilder {
336337
}
337338

338339
pub fn mkdir(&self, p: &Path) -> io::Result<()> {
339-
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;
340341
let fd = cvt(syscall::open(p.to_str().unwrap(), flags | (self.mode as usize & 0o777)))?;
341342
let _ = syscall::close(fd);
342343
Ok(())

0 commit comments

Comments
 (0)