1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-08-12 12:00:21 +02:00

timeout.c: don't use perror; exit 125 upon failed fork

* src/timeout.c (main): Use "error", not perror.
Elbert Pol noticed a build failure on OS/2.
* src/timeout.c (main): Exit 125 (not errno) upon failed fork.
Make the failed fork diagnostic match the one from install.c.
This commit is contained in:
Jim Meyering
2008-10-03 18:29:39 +02:00
parent e505736f82
commit 15f4d612df
+3 -3
View File
@@ -284,8 +284,8 @@ main (int argc, char **argv)
monitored_pid = fork ();
if (monitored_pid == -1)
{
perror ("fork");
return errno;
error (0, errno, _("fork system call failed"));
return EXIT_CANCELED;
}
else if (monitored_pid == 0)
{ /* child */
@@ -299,7 +299,7 @@ main (int argc, char **argv)
/* exit like sh, env, nohup, ... */
exit_status = (errno == ENOENT ? EXIT_ENOENT : EXIT_CANNOT_INVOKE);
perror (argv[0]);
error (0, errno, _("cannot run command %s"), quote (argv[0]));
return exit_status;
}
else