From f474a9fd77e214e9c5d5bdfb4334dc88a59f1346 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott <ian@iandouglasscott.com> Date: Sat, 12 Aug 2017 11:32:39 -0700 Subject: [PATCH] Actually, O_RDONLY should work with a directory --- mount/redox/scheme.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mount/redox/scheme.rs b/mount/redox/scheme.rs index ffe888e..489ec73 100644 --- a/mount/redox/scheme.rs +++ b/mount/redox/scheme.rs @@ -189,7 +189,7 @@ impl Scheme for FileScheme { Some(node) => if flags & (O_CREAT | O_EXCL) == O_CREAT | O_EXCL { return Err(Error::new(EEXIST)); } else if node.1.is_dir() { - if flags & O_ACCMODE == O_RDONLY && flags & O_DIRECTORY == O_DIRECTORY { + if flags & O_ACCMODE == O_RDONLY { if ! node.1.permission(uid, gid, Node::MODE_READ) { // println!("dir not readable {:o}", node.1.mode); return Err(Error::new(EACCES)); @@ -209,7 +209,7 @@ impl Scheme for FileScheme { } Box::new(DirResource::new(path.to_string(), node.0, data)) - } else if flags & O_RDONLY == O_RDONLY || flags & O_WRONLY == O_WRONLY { + } else if flags & O_WRONLY == O_WRONLY { // println!("{:X} & {:X}: EISDIR {}", flags, O_DIRECTORY, path); return Err(Error::new(EISDIR)); } else { -- GitLab