Skip to content

Commit fcc22f2

Browse files
committed
Remove broken execvpe implementation
It was broken when enabled, and currently the libc definition is only available for windows. This will be re-added when a new libc is released that supports it across all available platforms
1 parent b3b221e commit fcc22f2

File tree

3 files changed

+0
-29
lines changed

3 files changed

+0
-29
lines changed

Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ exclude = [
1515
"test/**/*"
1616
]
1717

18-
[features]
19-
execvpe = []
20-
2118
[dependencies]
2219
libc = "0.2.25"
2320
bitflags = "0.9"

src/unistd.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1596,9 +1596,6 @@ mod linux {
15961596
use {Errno, Result, NixPath};
15971597
use super::{Uid, Gid};
15981598

1599-
#[cfg(feature = "execvpe")]
1600-
use std::ffi::CString;
1601-
16021599
pub fn pivot_root<P1: ?Sized + NixPath, P2: ?Sized + NixPath>(
16031600
new_root: &P1, put_old: &P2) -> Result<()> {
16041601
let res = try!(try!(new_root.with_nix_path(|new_root| {
@@ -1643,23 +1640,4 @@ mod linux {
16431640

16441641
Errno::result(res).map(drop)
16451642
}
1646-
1647-
#[inline]
1648-
#[cfg(feature = "execvpe")]
1649-
pub fn execvpe(filename: &CString, args: &[CString], env: &[CString]) -> Result<()> {
1650-
use std::ptr;
1651-
use libc::c_char;
1652-
1653-
let mut args_p: Vec<*const c_char> = args.iter().map(|s| s.as_ptr()).collect();
1654-
args_p.push(ptr::null());
1655-
1656-
let mut env_p: Vec<*const c_char> = env.iter().map(|s| s.as_ptr()).collect();
1657-
env_p.push(ptr::null());
1658-
1659-
unsafe {
1660-
super::ffi::execvpe(filename.as_ptr(), args_p.as_ptr(), env_p.as_ptr())
1661-
};
1662-
1663-
Err(Error::Sys(Errno::last()))
1664-
}
16651643
}

test/test_unistd.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,6 @@ fn test_lseek64() {
217217

218218
execve_test_factory!(test_execve, execve, b"/bin/sh", b"/system/bin/sh");
219219

220-
#[cfg(any(target_os = "linux", target_os = "android"))]
221-
#[cfg(feature = "execvpe")]
222-
execve_test_factory!(test_execvpe, execvpe, b"sh", b"sh");
223-
224220
#[test]
225221
fn test_fpathconf_limited() {
226222
let f = tempfile().unwrap();

0 commit comments

Comments
 (0)