aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2012-02-02 07:42:31 -0600
committerRob Landley <rob@landley.net>2012-02-02 07:42:31 -0600
commit186e384515e9dc312f8b4f46ec545c3ee3bb165b (patch)
treef026632b25f23e361a5c12f5100392b3abccdbfd /toys
parent9201a01813920f8cfe674dc25c2454b9f0369494 (diff)
downloadtoybox-186e384515e9dc312f8b4f46ec545c3ee3bb165b.tar.gz
Very slight efficiency tweak.
Diffstat (limited to 'toys')
-rw-r--r--toys/nohup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/toys/nohup.c b/toys/nohup.c
index ab59c1e2..e11fb094 100644
--- a/toys/nohup.c
+++ b/toys/nohup.c
@@ -24,7 +24,7 @@ config NOHUP
void nohup_main(void)
{
signal(SIGHUP, SIG_IGN);
- if (ttyname(1)) {
+ if (isatty(1)) {
close(1);
if (-1 == open("nohup.out", O_CREAT|O_APPEND|O_WRONLY,
S_IRUSR|S_IWUSR ))
@@ -34,7 +34,7 @@ void nohup_main(void)
xcreate(temp, O_CREAT|O_APPEND|O_WRONLY, S_IRUSR|S_IWUSR);
}
}
- if (ttyname(0)) {
+ if (isatty(0)) {
close(0);
open("/dev/null", O_RDONLY);
}