@@ -233,7 +233,7 @@ static int wait_or_whine(pid_t pid, const char *argv0, int in_signal)
233
233
234
234
if (waiting < 0 ) {
235
235
failed_errno = errno ;
236
- error ("waitpid for %s failed: %s " , argv0 , strerror ( errno ) );
236
+ error_errno ("waitpid for %s failed" , argv0 );
237
237
} else if (waiting != pid ) {
238
238
error ("waitpid is confused (%s)" , argv0 );
239
239
} else if (WIFSIGNALED (status )) {
@@ -420,8 +420,7 @@ int start_command(struct child_process *cmd)
420
420
}
421
421
}
422
422
if (cmd -> pid < 0 )
423
- error ("cannot fork() for %s: %s" , cmd -> argv [0 ],
424
- strerror (errno ));
423
+ error_errno ("cannot fork() for %s" , cmd -> argv [0 ]);
425
424
else if (cmd -> clean_on_exit )
426
425
mark_child_for_cleanup (cmd -> pid );
427
426
@@ -482,7 +481,7 @@ int start_command(struct child_process *cmd)
482
481
cmd -> dir , fhin , fhout , fherr );
483
482
failed_errno = errno ;
484
483
if (cmd -> pid < 0 && (!cmd -> silent_exec_failure || errno != ENOENT ))
485
- error ("cannot spawn %s: %s " , cmd -> argv [0 ], strerror ( errno ) );
484
+ error_errno ("cannot spawn %s" , cmd -> argv [0 ]);
486
485
if (cmd -> clean_on_exit && cmd -> pid >= 0 )
487
486
mark_child_for_cleanup (cmd -> pid );
488
487
@@ -693,7 +692,7 @@ int start_async(struct async *async)
693
692
if (pipe (fdin ) < 0 ) {
694
693
if (async -> out > 0 )
695
694
close (async -> out );
696
- return error ("cannot create pipe: %s" , strerror ( errno ) );
695
+ return error_errno ("cannot create pipe" );
697
696
}
698
697
async -> in = fdin [1 ];
699
698
}
@@ -705,7 +704,7 @@ int start_async(struct async *async)
705
704
close_pair (fdin );
706
705
else if (async -> in )
707
706
close (async -> in );
708
- return error ("cannot create pipe: %s" , strerror ( errno ) );
707
+ return error_errno ("cannot create pipe" );
709
708
}
710
709
async -> out = fdout [0 ];
711
710
}
@@ -730,7 +729,7 @@ int start_async(struct async *async)
730
729
731
730
async -> pid = fork ();
732
731
if (async -> pid < 0 ) {
733
- error ("fork (async) failed: %s" , strerror ( errno ) );
732
+ error_errno ("fork (async) failed" );
734
733
goto error ;
735
734
}
736
735
if (!async -> pid ) {
@@ -777,7 +776,7 @@ int start_async(struct async *async)
777
776
{
778
777
int err = pthread_create (& async -> tid , NULL , run_thread , async );
779
778
if (err ) {
780
- error ("cannot create thread: %s" , strerror ( err ) );
779
+ error_errno ("cannot create thread" );
781
780
goto error ;
782
781
}
783
782
}
0 commit comments