mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
nohup: if fd_repoen fails (redirecting stdin), report it
* src/nohup.c (main): Don't ignore fd_reopen failure.
This commit is contained in:
1 parent
6ee02e3d83
commit
c149538652
1 file changed
+5
-1
+5
-1
@@ -123,7 +123,11 @@ main (int argc, char **argv)
|
||||
to ensure any read evokes an error. */
|
||||
if (ignoring_input)
|
||||
{
|
||||
fd_reopen (STDIN_FILENO, "/dev/null", O_WRONLY, 0);
|
||||
if (fd_reopen (STDIN_FILENO, "/dev/null", O_WRONLY, 0) < 0)
|
||||
{
|
||||
error (0, errno, _("failed to render standard input unusable"));
|
||||
exit (exit_internal_failure);
|
||||
}
|
||||
if (!redirecting_stdout && !redirecting_stderr)
|
||||
error (0, 0, _("ignoring input"));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user