summaryrefslogtreecommitdiff
path: root/src/timeout.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2008-10-03 18:29:39 +0200
committerJim Meyering <meyering@redhat.com>2008-10-03 18:39:31 +0200
commit15f4d612df8eed7014f76825ad986fb8c769ec5d (patch)
tree1e20e2a7b31430891b46f6edf6dcfc3259908bd8 /src/timeout.c
parente505736f8211a608b00dfe75fb186a5211e1a183 (diff)
downloadcoreutils-15f4d612df8eed7014f76825ad986fb8c769ec5d.tar.xz
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.
Diffstat (limited to 'src/timeout.c')
-rw-r--r--src/timeout.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/timeout.c b/src/timeout.c
index 37bed3c09..8b506f0c9 100644
--- a/src/timeout.c
+++ b/src/timeout.c
@@ -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