diff options
author | Ossi Herrala <oherrala@iki.fi> | 2020-05-13 11:15:03 +0300 |
---|---|---|
committer | Ossi Herrala <oherrala@iki.fi> | 2020-05-17 11:24:18 +0300 |
commit | 71aa2a6e9a51127d5bed8da38a69aa0894a5fa80 (patch) | |
tree | 8d8916b22cdfd41ae77c513b3628a648cb6b98a4 /src/unistd.rs | |
parent | 2f78ec2bba5bbeac2c666745da1423b8c326f61a (diff) | |
download | nix-71aa2a6e9a51127d5bed8da38a69aa0894a5fa80.zip |
Replace void crate with Rust standard lib Infallible type
std::convert::Infallible has been available since Rust 1.34 and nix
currently targets Rust 1.36 or later so this should not cause
problems.
Fixes #1238
Diffstat (limited to 'src/unistd.rs')
-rw-r--r-- | src/unistd.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/unistd.rs b/src/unistd.rs index fff103c0..3589cb72 100644 --- a/src/unistd.rs +++ b/src/unistd.rs @@ -7,11 +7,11 @@ use fcntl::FcntlArg::F_SETFD; use libc::{self, c_char, c_void, c_int, c_long, c_uint, size_t, pid_t, off_t, uid_t, gid_t, mode_t, PATH_MAX}; use std::{fmt, mem, ptr}; +use std::convert::Infallible; use std::ffi::{CString, CStr, OsString, OsStr}; use std::os::unix::ffi::{OsStringExt, OsStrExt}; use std::os::unix::io::RawFd; use std::path::PathBuf; -use void::Void; use sys::stat::Mode; #[cfg(any(target_os = "android", target_os = "linux"))] @@ -707,7 +707,7 @@ fn to_exec_array(args: &[&CStr]) -> Vec<*const c_char> { /// performs the same action but does not allow for customization of the /// environment for the new process. #[inline] -pub fn execv(path: &CStr, argv: &[&CStr]) -> Result<Void> { +pub fn execv(path: &CStr, argv: &[&CStr]) -> Result<Infallible> { let args_p = to_exec_array(argv); unsafe { @@ -731,7 +731,7 @@ pub fn execv(path: &CStr, argv: &[&CStr]) -> Result<Void> { /// in the `args` list is an argument to the new process. Each element in the /// `env` list should be a string in the form "key=value". #[inline] -pub fn execve(path: &CStr, args: &[&CStr], env: &[&CStr]) -> Result<Void> { +pub fn execve(path: &CStr, args: &[&CStr], env: &[&CStr]) -> Result<Infallible> { let args_p = to_exec_array(args); let env_p = to_exec_array(env); @@ -752,7 +752,7 @@ pub fn execve(path: &CStr, args: &[&CStr], env: &[&CStr]) -> Result<Void> { /// would not work if "bash" was specified for the path argument, but `execvp` /// would assuming that a bash executable was on the system `PATH`. #[inline] -pub fn execvp(filename: &CStr, args: &[&CStr]) -> Result<Void> { +pub fn execvp(filename: &CStr, args: &[&CStr]) -> Result<Infallible> { let args_p = to_exec_array(args); unsafe { @@ -772,7 +772,7 @@ pub fn execvp(filename: &CStr, args: &[&CStr]) -> Result<Void> { #[cfg(any(target_os = "haiku", target_os = "linux", target_os = "openbsd"))] -pub fn execvpe(filename: &CStr, args: &[&CStr], env: &[&CStr]) -> Result<Void> { +pub fn execvpe(filename: &CStr, args: &[&CStr], env: &[&CStr]) -> Result<Infallible> { let args_p = to_exec_array(args); let env_p = to_exec_array(env); @@ -800,7 +800,7 @@ pub fn execvpe(filename: &CStr, args: &[&CStr], env: &[&CStr]) -> Result<Void> { target_os = "linux", target_os = "freebsd"))] #[inline] -pub fn fexecve(fd: RawFd, args: &[&CStr], env: &[&CStr]) -> Result<Void> { +pub fn fexecve(fd: RawFd, args: &[&CStr], env: &[&CStr]) -> Result<Infallible> { let args_p = to_exec_array(args); let env_p = to_exec_array(env); @@ -824,7 +824,7 @@ pub fn fexecve(fd: RawFd, args: &[&CStr], env: &[&CStr]) -> Result<Void> { #[cfg(any(target_os = "android", target_os = "linux"))] #[inline] pub fn execveat(dirfd: RawFd, pathname: &CStr, args: &[&CStr], - env: &[&CStr], flags: super::fcntl::AtFlags) -> Result<Void> { + env: &[&CStr], flags: super::fcntl::AtFlags) -> Result<Infallible> { let args_p = to_exec_array(args); let env_p = to_exec_array(env); |