# HG changeset patch # User Rob Landley # Date 1328190151 21600 # Node ID 82d70cff7357c43308fefa411178a582bb988175 # Parent 1ca548d46c8eb08fa077519adaaf40d9193daf44 Very slight efficiency tweak. diff -r 1ca548d46c8e -r 82d70cff7357 toys/nohup.c --- a/toys/nohup.c Thu Feb 02 07:29:09 2012 -0600 +++ b/toys/nohup.c Thu Feb 02 07:42:31 2012 -0600 @@ -24,7 +24,7 @@ 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 @@ 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); }