]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
nohup: clarify stdin redirection
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 27 Mar 2015 22:01:35 +0000 (15:01 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 27 Mar 2015 22:02:35 +0000 (15:02 -0700)
Problem reported by Isaac Schwabacher in:
http://bugs.gnu.org/20214
* doc/coreutils.texi (nohup invocation): Clarify that when nohup's
stdin gets redirected, it's unreadable.
* doc/coreutils.texi (nohup invocation):
* src/nohup.c (usage): Don't promise /dev/null.

doc/coreutils.texi
src/nohup.c

index 6110cecd0d49b9a2efe1b3dfac9e685bd5e7e303..3cbce63c995bb63cfac75aeb2b101f6ed8a3936e 100644 (file)
@@ -16714,12 +16714,13 @@ out.  Synopsis:
 nohup @var{command} [@var{arg}]@dots{}
 @end example
 
-If standard input is a terminal, it is redirected from
-@file{/dev/null} so that terminal sessions do not mistakenly consider
-the terminal to be used by the command.  This is a GNU
-extension; programs intended to be portable to non-GNU hosts
-should use @samp{nohup @var{command} [@var{arg}]@dots{} </dev/null}
-instead.
+If standard input is a terminal, redirect it so that terminal sessions
+do not mistakenly consider the terminal to be used by the command.
+Make the substitute file descriptor unreadable, so that commands that
+mistakenly attempt to read from standard input can report an error.
+This redirection is a GNU extension; programs intended to be portable
+to non-GNU hosts can use @samp{nohup @var{command} [@var{arg}]@dots{}
+0>/dev/null} instead.
 
 @flindex nohup.out
 If standard output is a terminal, the command's standard output is appended
index 9bc868604b66c573e28289e096f601aded942395..8cdacedb8a62453dafe0bc303d3136e90776122e 100644 (file)
@@ -63,7 +63,7 @@ Run COMMAND, ignoring hangup signals.\n\
       fputs (HELP_OPTION_DESCRIPTION, stdout);
       fputs (VERSION_OPTION_DESCRIPTION, stdout);
       printf (_("\n\
-If standard input is a terminal, redirect it from /dev/null.\n\
+If standard input is a terminal, redirect it from an unreadable file.\n\
 If standard output is a terminal, append output to 'nohup.out' if possible,\n\
 '$HOME/nohup.out' otherwise.\n\
 If standard error is a terminal, redirect it to standard output.\n\