summaryrefslogtreecommitdiff
path: root/src/sys/stat.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/sys/stat.rs
parent2b60633c8bdd5359c317bb74e698777106befb85 (diff)
downloadnix-47d2332c3c388ecf094fc1d1890a223f3189f330.zip
NixResult -> nix::Result; NixError -> nix::Error
Diffstat (limited to 'src/sys/stat.rs')
-rw-r--r--src/sys/stat.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/sys/stat.rs b/src/sys/stat.rs
index f51fec4a..d98d20ec 100644
--- a/src/sys/stat.rs
+++ b/src/sys/stat.rs
@@ -1,7 +1,7 @@
pub use libc::dev_t;
pub use libc::stat as FileStat;
-use {NixError, NixResult, NixPath, AsExtStr,from_ffi};
+use {Error, Result, NixPath, AsExtStr,from_ffi};
use errno::Errno;
use fcntl::Fd;
use libc::mode_t;
@@ -57,7 +57,7 @@ impl fmt::Debug for SFlag {
}
}
-pub fn mknod<P: ?Sized + NixPath>(path: &P, kind: SFlag, perm: Mode, dev: dev_t) -> NixResult<()> {
+pub fn mknod<P: ?Sized + NixPath>(path: &P, kind: SFlag, perm: Mode, dev: dev_t) -> Result<()> {
let res = try!(path.with_nix_path(|osstr| {
unsafe {
ffi::mknod(osstr.as_ext_str(), kind.bits | perm.bits() as mode_t, dev)
@@ -79,7 +79,7 @@ pub fn umask(mode: Mode) -> Mode {
Mode::from_bits(prev).expect("[BUG] umask returned invalid Mode")
}
-pub fn stat<P: ?Sized + NixPath>(path: &P) -> NixResult<FileStat> {
+pub fn stat<P: ?Sized + NixPath>(path: &P) -> Result<FileStat> {
let mut dst = unsafe { mem::uninitialized() };
let res = try!(path.with_nix_path(|osstr| {
unsafe {
@@ -88,18 +88,18 @@ pub fn stat<P: ?Sized + NixPath>(path: &P) -> NixResult<FileStat> {
}));
if res < 0 {
- return Err(NixError::Sys(Errno::last()));
+ return Err(Error::Sys(Errno::last()));
}
Ok(dst)
}
-pub fn fstat(fd: Fd) -> NixResult<FileStat> {
+pub fn fstat(fd: Fd) -> Result<FileStat> {
let mut dst = unsafe { mem::uninitialized() };
let res = unsafe { ffi::fstat(fd, &mut dst as *mut FileStat) };
if res < 0 {
- return Err(NixError::Sys(Errno::last()));
+ return Err(Error::Sys(Errno::last()));
}
Ok(dst)