From 5d7f9c618655472654b79eeb22a9d13ec89035e7 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Fri, 27 Feb 2015 22:41:32 -0800 Subject: Temporarily remove mount --- src/mount.rs | 32 +++++++++++++++++++------------- src/unistd.rs | 2 +- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/mount.rs b/src/mount.rs index e113b970..c8264559 100644 --- a/src/mount.rs +++ b/src/mount.rs @@ -1,5 +1,5 @@ -use libc::{c_ulong, c_int, c_void}; -use {NixResult, NixPath, from_ffi}; +use libc::{c_ulong, c_int}; +use {NixResult, NixPath, AsExtStr, from_ffi}; bitflags!( flags MsFlags: c_ulong { @@ -49,15 +49,18 @@ bitflags!( ); mod ffi { - use libc::{c_char, c_int, c_void, c_ulong}; + use libc::{c_char, c_int}; extern { + /* + * TODO: Bring back pub fn mount( source: *const c_char, target: *const c_char, fstype: *const c_char, flags: c_ulong, data: *const c_void) -> c_int; + */ pub fn umount(target: *const c_char) -> c_int; @@ -65,13 +68,15 @@ mod ffi { } } -// XXX: Should `data` be a `NixPath` here? +/* + * TODO: Bring this back with a test + * pub fn mount( - source: Option, + source: Option<&P1>, target: P2, - fstype: Option, + fstype: Option<&P3>, flags: MsFlags, - data: Option) -> NixResult<()> { + data: Option<&P4>) -> NixResult<()> { use libc; let res = try!(try!(try!(try!( @@ -80,8 +85,8 @@ pub fn mount(target: P) -> NixResult<()> { +pub fn umount(target: &P) -> NixResult<()> { let res = try!(target.with_nix_path(|ptr| { - unsafe { ffi::umount(ptr) } + unsafe { ffi::umount(ptr.as_ext_str()) } })); from_ffi(res) } -pub fn umount2(target: P, flags: MntFlags) -> NixResult<()> { +pub fn umount2(target: &P, flags: MntFlags) -> NixResult<()> { let res = try!(target.with_nix_path(|ptr| { - unsafe { ffi::umount2(ptr, flags.bits) } + unsafe { ffi::umount2(ptr.as_ext_str(), flags.bits) } })); from_ffi(res) diff --git a/src/unistd.rs b/src/unistd.rs index 47eb667a..a54bba3a 100644 --- a/src/unistd.rs +++ b/src/unistd.rs @@ -361,7 +361,7 @@ mod linux { use {NixError, NixResult, NixPath}; pub fn pivot_root( - new_root: P1, put_old: P2) -> NixResult<()> { + 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