diff options
author | Carl Lerche <me@carllerche.com> | 2015-05-28 15:46:53 -0700 |
---|---|---|
committer | Carl Lerche <me@carllerche.com> | 2015-05-28 15:46:53 -0700 |
commit | e2b08fad9c3334e2791aebc28fa1d71d0f76112b (patch) | |
tree | 6b1690264570ff9b21cc0d23b7b6251475365376 /src/fcntl.rs | |
parent | 663091bb2873fa45663b746bccefc85f223d13d6 (diff) | |
download | nix-e2b08fad9c3334e2791aebc28fa1d71d0f76112b.zip |
Remove std::os::unix::io::RawFd re-export
Diffstat (limited to 'src/fcntl.rs')
-rw-r--r-- | src/fcntl.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/fcntl.rs b/src/fcntl.rs index 76ea9f65..28fce037 100644 --- a/src/fcntl.rs +++ b/src/fcntl.rs @@ -2,13 +2,11 @@ use {Error, Result, NixPath}; use errno::Errno; use libc::mode_t; use sys::stat::Mode; +use std::os::unix::io::RawFd; pub use self::consts::*; pub use self::ffi::flock; -// Re-export Fd defined in std -pub type Fd = ::std::os::unix::io::RawFd; - #[allow(dead_code)] mod ffi { pub use libc::{open, fcntl}; @@ -71,7 +69,7 @@ mod ffi { } } -pub fn open<P: ?Sized + NixPath>(path: &P, oflag: OFlag, mode: Mode) -> Result<Fd> { +pub fn open<P: ?Sized + NixPath>(path: &P, oflag: OFlag, mode: Mode) -> Result<RawFd> { let fd = try!(path.with_nix_path(|cstr| { unsafe { ffi::open(cstr.as_ptr(), oflag.bits(), mode.bits() as mode_t) } })); @@ -84,8 +82,8 @@ pub fn open<P: ?Sized + NixPath>(path: &P, oflag: OFlag, mode: Mode) -> Result<F } pub enum FcntlArg<'a> { - F_DUPFD(Fd), - F_DUPFD_CLOEXEC(Fd), + F_DUPFD(RawFd), + F_DUPFD_CLOEXEC(RawFd), F_GETFD, F_SETFD(FdFlag), // FD_FLAGS F_GETFL, @@ -104,7 +102,7 @@ pub enum FcntlArg<'a> { } // TODO: Figure out how to handle value fcntl returns -pub fn fcntl(fd: Fd, arg: FcntlArg) -> Result<()> { +pub fn fcntl(fd: RawFd, arg: FcntlArg) -> Result<()> { use self::FcntlArg::*; let res = unsafe { |