From 73c368ddab0055b1d9e7e0438f51bf8eefbc63e5 Mon Sep 17 00:00:00 2001 From: Jeremy Soller <jeremy@system76.com> Date: Tue, 19 Feb 2019 19:29:19 -0700 Subject: [PATCH] Use correct open flags --- src/header/fcntl/redox.rs | 36 ++++++++++++++++++------------------ src/platform/redox/mod.rs | 2 +- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/header/fcntl/redox.rs b/src/header/fcntl/redox.rs index c635e991..ddc189ba 100644 --- a/src/header/fcntl/redox.rs +++ b/src/header/fcntl/redox.rs @@ -1,20 +1,20 @@ use platform::types::*; -pub const O_RDONLY: c_int = 0x0001; -pub const O_WRONLY: c_int = 0x0002; -pub const O_RDWR: c_int = 0x0003; -pub const O_ACCMODE: c_int = 0x0003; -pub const O_NONBLOCK: c_int = 0x0004; -pub const O_APPEND: c_int = 0x0008; -pub const O_SHLOCK: c_int = 0x0010; -pub const O_EXLOCK: c_int = 0x0020; -pub const O_ASYNC: c_int = 0x0040; -pub const O_FSYNC: c_int = 0x0080; -pub const O_CLOEXEC: c_int = 0x0100; -pub const O_CREAT: c_int = 0x0200; -pub const O_TRUNC: c_int = 0x0400; -pub const O_EXCL: c_int = 0x0800; -pub const O_DIRECTORY: c_int = 0x1000; -pub const O_PATH: c_int = 0x2000; -pub const O_SYMLINK: c_int = 0x4000; -pub const O_NOFOLLOW: c_int = 0x8000; +pub const O_RDONLY: c_int = 0x0001_0000; +pub const O_WRONLY: c_int = 0x0002_0000; +pub const O_RDWR: c_int = 0x0003_0000; +pub const O_ACCMODE: c_int = 0x0003_0000; +pub const O_NONBLOCK: c_int = 0x0004_0000; +pub const O_APPEND: c_int = 0x0008_0000; +pub const O_SHLOCK: c_int = 0x0010_0000; +pub const O_EXLOCK: c_int = 0x0020_0000; +pub const O_ASYNC: c_int = 0x0040_0000; +pub const O_FSYNC: c_int = 0x0080_0000; +pub const O_CLOEXEC: c_int = 0x0100_0000; +pub const O_CREAT: c_int = 0x0200_0000; +pub const O_TRUNC: c_int = 0x0400_0000; +pub const O_EXCL: c_int = 0x0800_0000; +pub const O_DIRECTORY: c_int = 0x1000_0000; +pub const O_PATH: c_int = 0x2000_0000; +pub const O_SYMLINK: c_int = 0x4000_0000; +pub const O_NOFOLLOW: c_int = 0x8000_0000; diff --git a/src/platform/redox/mod.rs b/src/platform/redox/mod.rs index 1e568bb0..a1b801a3 100644 --- a/src/platform/redox/mod.rs +++ b/src/platform/redox/mod.rs @@ -679,7 +679,7 @@ impl Pal for Sys { fn open(path: &CStr, oflag: c_int, mode: mode_t) -> c_int { e(syscall::open( path.to_bytes(), - ((oflag as usize) << 16) | ((mode as usize) & 0xFFFF), + ((oflag as usize) & 0xFFFF_0000) | ((mode as usize) & 0xFFFF), )) as c_int } -- GitLab