summaryrefslogtreecommitdiff
path: root/src/nohup.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2005-07-15 21:55:13 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2005-07-15 21:55:13 +0000
commitef5043084faf7ffbd069efadeddd1d1e4f03111e (patch)
treefed12339332194e2e25c5d11a7d0674f54802e5c /src/nohup.c
parentadbbc35f87fb72767c05cec8d9b029a482bf75d4 (diff)
downloadcoreutils-ef5043084faf7ffbd069efadeddd1d1e4f03111e.tar.xz
(main): Don't worry about POSIXLY_CORRECT.
Diffstat (limited to 'src/nohup.c')
-rw-r--r--src/nohup.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/nohup.c b/src/nohup.c
index 6cf9c9b78..b8b8c76b0 100644
--- a/src/nohup.c
+++ b/src/nohup.c
@@ -97,12 +97,8 @@ main (int argc, char **argv)
usage (NOHUP_FAILURE);
}
- /* If standard input is a tty, replace it with a file descriptor
- that exists but gives you an error if you try to read it. POSIX
- requires nohup to leave standard input alone, but that's less
- useful in practice as it causes a "nohup foo & exit" session to
- hang with OpenSSH. */
- if (!getenv ("POSIXLY_CORRECT") && isatty (STDIN_FILENO))
+ /* If standard input is a tty, replace it with /dev/null. */
+ if (isatty (STDIN_FILENO))
fd_reopen (STDIN_FILENO, "/dev/null", O_WRONLY, 0);
/* If standard output is a tty, redirect it (appending) to a file.