aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2014-06-11 22:43:54 -0500
committerRob Landley <rob@landley.net>2014-06-11 22:43:54 -0500
commit0cf6a2dbcd58511a775c031112e25ecf3b5b5b5b (patch)
treeb0066409f02bd4ea5e6df72f1f28563823755c36
parent2109b158f496b3ecccea34c960b45f7aeba6679e (diff)
downloadtoybox-0cf6a2dbcd58511a775c031112e25ecf3b5b5b5b.tar.gz
Option parsing for nohup needs to stop at first nonoption argument. Minor cleanups.
-rw-r--r--toys/posix/nohup.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/toys/posix/nohup.c b/toys/posix/nohup.c
index 42d0e116..0cece0b5 100644
--- a/toys/posix/nohup.c
+++ b/toys/posix/nohup.c
@@ -4,7 +4,7 @@
*
* 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))
config NOHUP
bool "nohup"
@@ -13,8 +13,8 @@ config NOHUP
usage: nohup COMMAND [ARGS...]
Run a command that survives the end of its terminal.
- If stdin is a tty, redirect from /dev/null
- If stdout is a tty, redirect to file "nohup.out"
+
+ Redirect tty on stdin to /dev/null, tty on stdout to "nohup.out".
*/
#include "toys.h"
@@ -29,7 +29,7 @@ void nohup_main(void)
{
char *temp = getenv("HOME");
temp = xmprintf("%s/%s", temp ? temp : "", "nohup.out");
- xcreate(temp, O_CREAT|O_APPEND|O_WRONLY, S_IRUSR|S_IWUSR);
+ xcreate(temp, O_CREAT|O_APPEND|O_WRONLY, 0600);
}
}
if (isatty(0)) {