From e8a58c83a50ef7e197767b5a491050ae91c9e503 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Thu, 26 Feb 2015 17:45:01 -0800 Subject: Further SockAddr & NixPath cleanup --- src/unistd.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/unistd.rs') diff --git a/src/unistd.rs b/src/unistd.rs index a407b26c..47eb667a 100644 --- a/src/unistd.rs +++ b/src/unistd.rs @@ -1,6 +1,6 @@ //! Standard symbolic constants and types //! -use {NixError, NixResult, NixPath, from_ffi}; +use {NixError, NixResult, NixPath, AsExtStr, from_ffi}; use errno::Errno; use fcntl::{fcntl, Fd, OFlag, O_NONBLOCK, O_CLOEXEC, FD_CLOEXEC}; use fcntl::FcntlArg::{F_SETFD, F_SETFL}; @@ -153,9 +153,9 @@ fn dup3_polyfill(oldfd: Fd, newfd: Fd, flags: OFlag) -> NixResult { } #[inline] -pub fn chdir(path: P) -> NixResult<()> { - let res = try!(path.with_nix_path(|ptr| { - unsafe { ffi::chdir(ptr) } +pub fn chdir(path: &P) -> NixResult<()> { + let res = try!(path.with_nix_path(|osstr| { + unsafe { ffi::chdir(osstr.as_ext_str()) } })); if res != 0 { @@ -345,10 +345,10 @@ pub fn isatty(fd: Fd) -> NixResult { } } -pub fn unlink(path: P) -> NixResult<()> { - let res = try!(path.with_nix_path(|ptr| { +pub fn unlink(path: &P) -> NixResult<()> { + let res = try!(path.with_nix_path(|osstr| { unsafe { - ffi::unlink(ptr) + ffi::unlink(osstr.as_ext_str()) } })); from_ffi(res) @@ -360,8 +360,8 @@ mod linux { use errno::Errno; use {NixError, NixResult, NixPath}; - pub fn pivot_root(new_root: P1, - put_old: P2) -> NixResult<()> { + pub fn pivot_root( + new_root: P1, put_old: P2) -> NixResult<()> { let res = try!(try!(new_root.with_nix_path(|new_root| { put_old.with_nix_path(|put_old| { unsafe { -- cgit v1.2.3