summaryrefslogtreecommitdiff
path: root/src/fcntl.rs
diff options
context:
space:
mode:
authorUtkarsh Kukreti <utkarshkukreti@gmail.com>2015-01-27 17:46:29 +0530
committerUtkarsh Kukreti <utkarshkukreti@gmail.com>2015-01-27 17:54:16 +0530
commita8cd40400f8b6f8575e675f2c06593008696abba (patch)
tree5b08f0b9b88cfc61e047f69b4bf1e978ea07f8cd /src/fcntl.rs
parentcc277646472996833a8670ddb3f927ff409c4084 (diff)
downloadnix-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.rs4
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 {