summaryrefslogtreecommitdiff
path: root/src/nohup.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2004-01-21 23:31:33 +0000
committerJim Meyering <jim@meyering.net>2004-01-21 23:31:33 +0000
commitcdc257accd12df8ba48b34c9676509ec03326166 (patch)
tree02f144ee246a236e22b0735ae420631f2c9614d4 /src/nohup.c
parentd2e7cd3b7ab05092ce3a6df36241134dbb426a7a (diff)
downloadcoreutils-cdc257accd12df8ba48b34c9676509ec03326166.tar.xz
(usage): Use EXIT_SUCCESS, not 0, for clarity.
(main): Initialize exit_failure to EXIT_FAIL. (main): Use EXIT_ENOENT and EXIT_CANNOT_INVOKE rather than roll-your-own symbols or integers. (NOHUP_FOUND_BUT_CANNOT_INVOKE): Remove; all uses changed to EXIT_CANNOT_INVOKE.
Diffstat (limited to 'src/nohup.c')
-rw-r--r--src/nohup.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/nohup.c b/src/nohup.c
index 6d006f216..d524424ec 100644
--- a/src/nohup.c
+++ b/src/nohup.c
@@ -1,5 +1,5 @@
/* nohup -- run a command immume to hangups, with output to a non-tty
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -36,10 +36,7 @@
/* Exit statuses. */
enum
{
- /* `nohup' found the specified command but failed to invoke it. */
- NOHUP_FOUND_BUT_CANNOT_INVOKE = 126,
-
- /* `nohup' itself failed, or did not find the specified command. */
+ /* `nohup' itself failed. */
NOHUP_FAILURE = 127
};
@@ -48,7 +45,7 @@ char *program_name;
void
usage (int status)
{
- if (status != 0)
+ if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
@@ -83,6 +80,7 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+ initialize_exit_failure (NOHUP_FAILURE);
atexit (close_stdout);
parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION,
@@ -173,9 +171,7 @@ main (int argc, char **argv)
char **cmd = argv + 1;
execvp (*cmd, cmd);
- exit_status = (errno == ENOENT
- ? NOHUP_FAILURE
- : NOHUP_FOUND_BUT_CANNOT_INVOKE);
+ exit_status = (errno == ENOENT ? EXIT_ENOENT : EXIT_CANNOT_INVOKE);
saved_errno = errno;
/* The execve failed. Output a diagnostic to stderr only if: