summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nohup.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nohup.c b/src/nohup.c
index b8b8c76b0..bd3bc3bd7 100644
--- a/src/nohup.c
+++ b/src/nohup.c
@@ -97,7 +97,9 @@ main (int argc, char **argv)
usage (NOHUP_FAILURE);
}
- /* If standard input is a tty, replace it with /dev/null. */
+ /* If standard input is a tty, replace it with /dev/null.
+ Note that it is deliberately opened for *writing*,
+ to ensure any read evokes an error. */
if (isatty (STDIN_FILENO))
fd_reopen (STDIN_FILENO, "/dev/null", O_WRONLY, 0);