diff options
Diffstat (limited to 'run-command.c')
-rw-r--r-- | run-command.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/run-command.c b/run-command.c index aece872e33..1b7f88eeb1 100644 --- a/run-command.c +++ b/run-command.c @@ -76,7 +76,10 @@ static inline void close_pair(int fd[2]) static inline void dup_devnull(int to) { int fd = open("/dev/null", O_RDWR); - dup2(fd, to); + if (fd < 0) + die_errno(_("open /dev/null failed")); + if (dup2(fd, to) < 0) + die_errno(_("dup2(%d,%d) failed"), fd, to); close(fd); } #endif |