diff --git a/run-command.c b/run-command.c
index 7e4ca43c626d4d60a2eeae79e0268e621931998c..cfbad74d145145944352c568064cc2f8c0d4c5cb 100644 (file)
--- a/run-command.c
+++ b/run-command.c
if (pid < 0)
return -ERR_RUN_COMMAND_FORK;
if (!pid) {
if (pid < 0)
return -ERR_RUN_COMMAND_FORK;
if (!pid) {
- if (flags & RUN_COMMAND_NO_STDIO) {
+ if (flags & RUN_COMMAND_NO_STDIN) {
int fd = open("/dev/null", O_RDWR);
dup2(fd, 0);
int fd = open("/dev/null", O_RDWR);
dup2(fd, 0);
- dup2(fd, 1);
close(fd);
close(fd);
- } else if (flags & RUN_COMMAND_STDOUT_TO_STDERR)
+ }
+ if (flags & RUN_COMMAND_STDOUT_TO_STDERR)
dup2(2, 1);
if (flags & RUN_GIT_CMD) {
execv_git_cmd(argv);
dup2(2, 1);
if (flags & RUN_GIT_CMD) {
execv_git_cmd(argv);