summaryrefslogtreecommitdiff
path: root/src/nohup.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2005-08-12 08:25:52 +0000
committerJim Meyering <jim@meyering.net>2005-08-12 08:25:52 +0000
commit1442403a5da3f891b6f7f07b4f36a687c39e94c0 (patch)
tree272ec1e4b1936e664a065ce85824cd7e58246aed /src/nohup.c
parent19b17d2ce62dc279449cc93e0175943473690540 (diff)
downloadcoreutils-1442403a5da3f891b6f7f07b4f36a687c39e94c0.tar.xz
(main): Explain why we reopen stdin for write-only access.
Diffstat (limited to 'src/nohup.c')
-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);