@@ -335,25 +335,25 @@ impl Command {
335
335
// have the drop glue anyway because this code never returns (the
336
336
// child will either exec() or invoke libc::exit)
337
337
unsafe fn do_exec ( & mut self , stdio : ChildPipes ) -> io:: Error {
338
- macro_rules! try {
338
+ macro_rules! t {
339
339
( $e: expr) => ( match $e {
340
340
Ok ( e) => e,
341
341
Err ( e) => return e,
342
342
} )
343
343
}
344
344
345
345
if let Some ( fd) = stdio. stdin . fd ( ) {
346
- cvt_r ( || libc:: dup2 ( fd, libc:: STDIN_FILENO ) ) ? ;
346
+ t ! ( cvt_r( || libc:: dup2( fd, libc:: STDIN_FILENO ) ) ) ;
347
347
}
348
348
if let Some ( fd) = stdio. stdout . fd ( ) {
349
- cvt_r ( || libc:: dup2 ( fd, libc:: STDOUT_FILENO ) ) ? ;
349
+ t ! ( cvt_r( || libc:: dup2( fd, libc:: STDOUT_FILENO ) ) ) ;
350
350
}
351
351
if let Some ( fd) = stdio. stderr . fd ( ) {
352
- cvt_r ( || libc:: dup2 ( fd, libc:: STDERR_FILENO ) ) ? ;
352
+ t ! ( cvt_r( || libc:: dup2( fd, libc:: STDERR_FILENO ) ) ) ;
353
353
}
354
354
355
355
if let Some ( u) = self . gid {
356
- cvt ( libc:: setgid ( u as gid_t ) ) ? ;
356
+ t ! ( cvt( libc:: setgid( u as gid_t) ) ) ;
357
357
}
358
358
if let Some ( u) = self . uid {
359
359
// When dropping privileges from root, the `setgroups` call
@@ -365,7 +365,7 @@ impl Command {
365
365
// privilege dropping function.
366
366
let _ = libc:: setgroups ( 0 , ptr:: null ( ) ) ;
367
367
368
- cvt ( libc:: setuid ( u as uid_t ) ) ? ;
368
+ t ! ( cvt( libc:: setuid( u as uid_t) ) ) ;
369
369
}
370
370
if self . session_leader {
371
371
// Don't check the error of setsid because it fails if we're the
@@ -374,7 +374,7 @@ impl Command {
374
374
let _ = libc:: setsid ( ) ;
375
375
}
376
376
if let Some ( ref cwd) = self . cwd {
377
- cvt ( libc:: chdir ( cwd. as_ptr ( ) ) ) ? ;
377
+ t ! ( cvt( libc:: chdir( cwd. as_ptr( ) ) ) ) ;
378
378
}
379
379
if let Some ( ref envp) = self . envp {
380
380
* sys:: os:: environ ( ) = envp. as_ptr ( ) ;
@@ -390,17 +390,17 @@ impl Command {
390
390
// need to clean things up now to avoid confusing the program
391
391
// we're about to run.
392
392
let mut set: libc:: sigset_t = mem:: uninitialized ( ) ;
393
- cvt ( libc:: sigemptyset ( & mut set) ) ? ;
394
- cvt ( libc:: pthread_sigmask ( libc:: SIG_SETMASK , & set,
395
- ptr:: null_mut ( ) ) ) ? ;
393
+ t ! ( cvt( libc:: sigemptyset( & mut set) ) ) ;
394
+ t ! ( cvt( libc:: pthread_sigmask( libc:: SIG_SETMASK , & set,
395
+ ptr:: null_mut( ) ) ) ) ;
396
396
let ret = libc:: signal ( libc:: SIGPIPE , libc:: SIG_DFL ) ;
397
397
if ret == libc:: SIG_ERR {
398
398
return io:: Error :: last_os_error ( )
399
399
}
400
400
}
401
401
402
402
for callback in self . closures . iter_mut ( ) {
403
- callback ( ) ? ;
403
+ t ! ( callback( ) ) ;
404
404
}
405
405
406
406
libc:: execvp ( self . argv [ 0 ] , self . argv . as_ptr ( ) ) ;
0 commit comments