Skip to content

Commit 5d7f9c6

Browse files
committed
Temporarily remove mount
1 parent e8a58c8 commit 5d7f9c6

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

src/mount.rs

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use libc::{c_ulong, c_int, c_void};
2-
use {NixResult, NixPath, from_ffi};
1+
use libc::{c_ulong, c_int};
2+
use {NixResult, NixPath, AsExtStr, from_ffi};
33

44
bitflags!(
55
flags MsFlags: c_ulong {
@@ -49,29 +49,34 @@ bitflags!(
4949
);
5050

5151
mod ffi {
52-
use libc::{c_char, c_int, c_void, c_ulong};
52+
use libc::{c_char, c_int};
5353

5454
extern {
55+
/*
56+
* TODO: Bring back
5557
pub fn mount(
5658
source: *const c_char,
5759
target: *const c_char,
5860
fstype: *const c_char,
5961
flags: c_ulong,
6062
data: *const c_void) -> c_int;
63+
*/
6164

6265
pub fn umount(target: *const c_char) -> c_int;
6366

6467
pub fn umount2(target: *const c_char, flags: c_int) -> c_int;
6568
}
6669
}
6770

68-
// XXX: Should `data` be a `NixPath` here?
71+
/*
72+
* TODO: Bring this back with a test
73+
*
6974
pub fn mount<P1: ?Sized + NixPath, P2: ?Sized + NixPath, P3: ?Sized + NixPath, P4: ?Sized + NixPath>(
70-
source: Option<P1>,
75+
source: Option<&P1>,
7176
target: P2,
72-
fstype: Option<P3>,
77+
fstype: Option<&P3>,
7378
flags: MsFlags,
74-
data: Option<P4>) -> NixResult<()> {
79+
data: Option<&P4>) -> NixResult<()> {
7580
use libc;
7681
7782
let res = try!(try!(try!(try!(
@@ -80,8 +85,8 @@ pub fn mount<P1: ?Sized + NixPath, P2: ?Sized + NixPath, P3: ?Sized + NixPath, P
8085
fstype.with_nix_path(|fstype| {
8186
data.with_nix_path(|data| {
8287
unsafe {
83-
ffi::mount(source,
84-
target,
88+
ffi::mount(source.as_ext_str(),
89+
target.as_ext_str(),
8590
fstype,
8691
flags.bits,
8792
data as *const libc::c_void)
@@ -93,18 +98,19 @@ pub fn mount<P1: ?Sized + NixPath, P2: ?Sized + NixPath, P3: ?Sized + NixPath, P
9398
9499
return from_ffi(res);
95100
}
101+
*/
96102

97-
pub fn umount<P: ?Sized + NixPath>(target: P) -> NixResult<()> {
103+
pub fn umount<P: ?Sized + NixPath>(target: &P) -> NixResult<()> {
98104
let res = try!(target.with_nix_path(|ptr| {
99-
unsafe { ffi::umount(ptr) }
105+
unsafe { ffi::umount(ptr.as_ext_str()) }
100106
}));
101107

102108
from_ffi(res)
103109
}
104110

105-
pub fn umount2<P: ?Sized + NixPath>(target: P, flags: MntFlags) -> NixResult<()> {
111+
pub fn umount2<P: ?Sized + NixPath>(target: &P, flags: MntFlags) -> NixResult<()> {
106112
let res = try!(target.with_nix_path(|ptr| {
107-
unsafe { ffi::umount2(ptr, flags.bits) }
113+
unsafe { ffi::umount2(ptr.as_ext_str(), flags.bits) }
108114
}));
109115

110116
from_ffi(res)

src/unistd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ mod linux {
361361
use {NixError, NixResult, NixPath};
362362

363363
pub fn pivot_root<P1: ?Sized + NixPath, P2: ?Sized + NixPath>(
364-
new_root: P1, put_old: P2) -> NixResult<()> {
364+
new_root: &P1, put_old: &P2) -> NixResult<()> {
365365
let res = try!(try!(new_root.with_nix_path(|new_root| {
366366
put_old.with_nix_path(|put_old| {
367367
unsafe {

0 commit comments

Comments
 (0)