diff options
author | Utkarsh Kukreti <utkarshkukreti@gmail.com> | 2015-01-27 17:46:29 +0530 |
---|---|---|
committer | Utkarsh Kukreti <utkarshkukreti@gmail.com> | 2015-01-27 17:54:16 +0530 |
commit | a8cd40400f8b6f8575e675f2c06593008696abba (patch) | |
tree | 5b08f0b9b88cfc61e047f69b4bf1e978ea07f8cd /src/fcntl.rs | |
parent | cc277646472996833a8670ddb3f927ff409c4084 (diff) | |
download | nix-a8cd40400f8b6f8575e675f2c06593008696abba.zip |
Add a `Mode` bitflags and use it instead of `std::io::FilePermission`.
These constants are defined in POSIX [1] so we should export them
anyways, plus we don't need to depend on `std::io` anymore!
[breaking-change]
[1]: http://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/stat.h.html
Diffstat (limited to 'src/fcntl.rs')
-rw-r--r-- | src/fcntl.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fcntl.rs b/src/fcntl.rs index ebc6a8f0..8e8a28a8 100644 --- a/src/fcntl.rs +++ b/src/fcntl.rs @@ -1,7 +1,7 @@ use std::path::Path; -use std::io::FilePermission; use libc::{c_int, mode_t}; use errno::{SysResult, SysError}; +use sys::stat::Mode; use utils::ToCStr; pub use self::consts::*; @@ -71,7 +71,7 @@ mod ffi { } } -pub fn open(path: &Path, oflag: OFlag, mode: FilePermission) -> SysResult<Fd> { +pub fn open(path: &Path, oflag: OFlag, mode: Mode) -> SysResult<Fd> { let fd = unsafe { ffi::open(path.to_c_str().as_ptr(), oflag.bits(), mode.bits() as mode_t) }; if fd < 0 { |