File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -65,8 +65,10 @@ impl FileHandle {
6565
6666 #[ inline]
6767 pub fn is_readable ( & self ) -> bool {
68- self . flags ( )
69- . intersects ( OpenFlags :: O_RDONLY | OpenFlags :: O_RDWR )
68+ // FIXME: switch to Linux ABI for fcntl. mlibc defines O_RDONLY as 0 so, we have to infer
69+ // the read-only flag.
70+ let flags = self . flags ( ) ;
71+ flags. contains ( OpenFlags :: O_RDWR ) || !flags. contains ( OpenFlags :: O_WRONLY )
7072 }
7173
7274 pub fn flags ( & self ) -> OpenFlags {
Original file line number Diff line number Diff line change @@ -1410,7 +1410,7 @@ impl Vm {
14101410 }
14111411
14121412 if !file. is_readable ( ) {
1413- // return None; // EACCES
1413+ return None ; // EACCES
14141414 }
14151415
14161416 // TODO: * check if the filsystem is noexec mounted and remove the MAY_EXEC flag.
@@ -1419,7 +1419,7 @@ impl Vm {
14191419
14201420 ( MMapFlags :: MAP_PRIVATE , Some ( file) ) => {
14211421 if !file. is_readable ( ) {
1422- // return None; // EACCES
1422+ return None ; // EACCES
14231423 }
14241424
14251425 // TODO: * check if the filsystem is noexec mounted and remove the MAY_EXEC flag.
You can’t perform that action at this time.
0 commit comments