diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nohup.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nohup.c b/src/nohup.c index 1f92c3f5a..ea0b56ef9 100644 --- a/src/nohup.c +++ b/src/nohup.c @@ -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")); } |