summaryrefslogtreecommitdiff
path: root/src/fcntl.rs
diff options
context:
space:
mode:
authorCarl Lerche <me@carllerche.com>2015-03-24 23:25:10 -0700
committerCarl Lerche <me@carllerche.com>2015-03-24 23:25:10 -0700
commit47d2332c3c388ecf094fc1d1890a223f3189f330 (patch)
treeee7bfae92f24d00e0732158f100caecd2f75c5f2 /src/fcntl.rs
parent2b60633c8bdd5359c317bb74e698777106befb85 (diff)
downloadnix-47d2332c3c388ecf094fc1d1890a223f3189f330.zip
NixResult -> nix::Result; NixError -> nix::Error
Diffstat (limited to 'src/fcntl.rs')
-rw-r--r--src/fcntl.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/fcntl.rs b/src/fcntl.rs
index 8a88cbc4..ca0a2266 100644
--- a/src/fcntl.rs
+++ b/src/fcntl.rs
@@ -1,4 +1,4 @@
-use {NixError, NixResult, NixPath, AsExtStr};
+use {Error, Result, NixPath, AsExtStr};
use errno::Errno;
use libc::mode_t;
use sys::stat::Mode;
@@ -71,13 +71,13 @@ mod ffi {
}
}
-pub fn open<P: ?Sized + NixPath>(path: &P, oflag: OFlag, mode: Mode) -> NixResult<Fd> {
+pub fn open<P: ?Sized + NixPath>(path: &P, oflag: OFlag, mode: Mode) -> Result<Fd> {
let fd = try!(path.with_nix_path(|osstr| {
unsafe { ffi::open(osstr.as_ext_str(), oflag.bits(), mode.bits() as mode_t) }
}));
if fd < 0 {
- return Err(NixError::Sys(Errno::last()));
+ return Err(Error::Sys(Errno::last()));
}
Ok(fd)
@@ -104,7 +104,7 @@ pub enum FcntlArg<'a> {
}
// TODO: Figure out how to handle value fcntl returns
-pub fn fcntl(fd: Fd, arg: FcntlArg) -> NixResult<()> {
+pub fn fcntl(fd: Fd, arg: FcntlArg) -> Result<()> {
use self::FcntlArg::*;
let res = unsafe {
@@ -116,7 +116,7 @@ pub fn fcntl(fd: Fd, arg: FcntlArg) -> NixResult<()> {
};
if res < 0 {
- return Err(NixError::Sys(Errno::last()));
+ return Err(Error::Sys(Errno::last()));
}
Ok(())