@@ -7,11 +7,11 @@ use fcntl::FcntlArg::F_SETFD;
7
7
use libc:: { self , c_char, c_void, c_int, c_long, c_uint, size_t, pid_t, off_t,
8
8
uid_t, gid_t, mode_t, PATH_MAX } ;
9
9
use std:: { fmt, mem, ptr} ;
10
+ use std:: convert:: Infallible ;
10
11
use std:: ffi:: { CString , CStr , OsString , OsStr } ;
11
12
use std:: os:: unix:: ffi:: { OsStringExt , OsStrExt } ;
12
13
use std:: os:: unix:: io:: RawFd ;
13
14
use std:: path:: PathBuf ;
14
- use void:: Void ;
15
15
use sys:: stat:: Mode ;
16
16
17
17
#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
@@ -707,7 +707,7 @@ fn to_exec_array(args: &[&CStr]) -> Vec<*const c_char> {
707
707
/// performs the same action but does not allow for customization of the
708
708
/// environment for the new process.
709
709
#[ inline]
710
- pub fn execv ( path : & CStr , argv : & [ & CStr ] ) -> Result < Void > {
710
+ pub fn execv ( path : & CStr , argv : & [ & CStr ] ) -> Result < Infallible > {
711
711
let args_p = to_exec_array ( argv) ;
712
712
713
713
unsafe {
@@ -731,7 +731,7 @@ pub fn execv(path: &CStr, argv: &[&CStr]) -> Result<Void> {
731
731
/// in the `args` list is an argument to the new process. Each element in the
732
732
/// `env` list should be a string in the form "key=value".
733
733
#[ inline]
734
- pub fn execve ( path : & CStr , args : & [ & CStr ] , env : & [ & CStr ] ) -> Result < Void > {
734
+ pub fn execve ( path : & CStr , args : & [ & CStr ] , env : & [ & CStr ] ) -> Result < Infallible > {
735
735
let args_p = to_exec_array ( args) ;
736
736
let env_p = to_exec_array ( env) ;
737
737
@@ -752,7 +752,7 @@ pub fn execve(path: &CStr, args: &[&CStr], env: &[&CStr]) -> Result<Void> {
752
752
/// would not work if "bash" was specified for the path argument, but `execvp`
753
753
/// would assuming that a bash executable was on the system `PATH`.
754
754
#[ inline]
755
- pub fn execvp ( filename : & CStr , args : & [ & CStr ] ) -> Result < Void > {
755
+ pub fn execvp ( filename : & CStr , args : & [ & CStr ] ) -> Result < Infallible > {
756
756
let args_p = to_exec_array ( args) ;
757
757
758
758
unsafe {
@@ -772,7 +772,7 @@ pub fn execvp(filename: &CStr, args: &[&CStr]) -> Result<Void> {
772
772
#[ cfg( any( target_os = "haiku" ,
773
773
target_os = "linux" ,
774
774
target_os = "openbsd" ) ) ]
775
- pub fn execvpe ( filename : & CStr , args : & [ & CStr ] , env : & [ & CStr ] ) -> Result < Void > {
775
+ pub fn execvpe ( filename : & CStr , args : & [ & CStr ] , env : & [ & CStr ] ) -> Result < Infallible > {
776
776
let args_p = to_exec_array ( args) ;
777
777
let env_p = to_exec_array ( env) ;
778
778
@@ -800,7 +800,7 @@ pub fn execvpe(filename: &CStr, args: &[&CStr], env: &[&CStr]) -> Result<Void> {
800
800
target_os = "linux" ,
801
801
target_os = "freebsd" ) ) ]
802
802
#[ inline]
803
- pub fn fexecve ( fd : RawFd , args : & [ & CStr ] , env : & [ & CStr ] ) -> Result < Void > {
803
+ pub fn fexecve ( fd : RawFd , args : & [ & CStr ] , env : & [ & CStr ] ) -> Result < Infallible > {
804
804
let args_p = to_exec_array ( args) ;
805
805
let env_p = to_exec_array ( env) ;
806
806
@@ -824,7 +824,7 @@ pub fn fexecve(fd: RawFd, args: &[&CStr], env: &[&CStr]) -> Result<Void> {
824
824
#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
825
825
#[ inline]
826
826
pub fn execveat ( dirfd : RawFd , pathname : & CStr , args : & [ & CStr ] ,
827
- env : & [ & CStr ] , flags : super :: fcntl:: AtFlags ) -> Result < Void > {
827
+ env : & [ & CStr ] , flags : super :: fcntl:: AtFlags ) -> Result < Infallible > {
828
828
let args_p = to_exec_array ( args) ;
829
829
let env_p = to_exec_array ( env) ;
830
830
0 commit comments