Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'bc/http-backend-allow-405' into maint
[gitweb.git]
/
run-command.c
diff --git
a/run-command.c
b/run-command.c
index aece872e331caa28bf515c98f5cceb27d8414dff..1b7f88eeb1f1971f1568d5991978192c2d00645e 100644
(file)
--- 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