aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/nohup.c
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2019-03-18 20:37:53 -0700
committerRob Landley <rob@landley.net>2019-03-18 23:37:05 -0500
commit95574e3f2a47291651f7c78c873318344565e80e (patch)
treee3ff1282473f9f0724770fec64b2a4b3457364e2 /toys/posix/nohup.c
parent7709875b443fcd155e1737f18d3fff75c4b2753a (diff)
downloadtoybox-95574e3f2a47291651f7c78c873318344565e80e.tar.gz
cmp/env/nice/nohup/sort: use TOYFLAG_ARGFAIL.
Also be a bit more consistent about `COMMAND [ARG...]` in usage text.
Diffstat (limited to 'toys/posix/nohup.c')
-rw-r--r--toys/posix/nohup.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/toys/posix/nohup.c b/toys/posix/nohup.c
index b302cbe4..e5b526f7 100644
--- a/toys/posix/nohup.c
+++ b/toys/posix/nohup.c
@@ -4,13 +4,13 @@
*
* See http://opengroup.org/onlinepubs/9699919799/utilities/nohup.html
-USE_NOHUP(NEWTOY(nohup, "<1^", TOYFLAG_USR|TOYFLAG_BIN))
+USE_NOHUP(NEWTOY(nohup, "<1^", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_ARGFAIL(125)))
config NOHUP
bool "nohup"
default y
help
- usage: nohup COMMAND [ARGS...]
+ usage: nohup COMMAND [ARG...]
Run a command that survives the end of its terminal.
@@ -21,6 +21,7 @@ config NOHUP
void nohup_main(void)
{
+ toys.exitval = 125;
xsignal(SIGHUP, SIG_IGN);
if (isatty(1)) {
close(1);
@@ -38,5 +39,6 @@ void nohup_main(void)
close(0);
xopen_stdio("/dev/null", O_RDONLY);
}
+ toys.exitval = 0;
xexec(toys.optargs);
}