]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(main): Explain why we reopen stdin for write-only access.
authorJim Meyering <jim@meyering.net>
Fri, 12 Aug 2005 08:25:52 +0000 (08:25 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 12 Aug 2005 08:25:52 +0000 (08:25 +0000)
src/nohup.c

index b8b8c76b08d9134d860ca08e4e2e422e9421bb63..bd3bc3bd7027920c55918a58d29340a73a000865 100644 (file)
@@ -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);