[PATCH 15/22] make redirecting stdout to /dev/null available via run_command_v_opt
From: Sven Verdoolaege <skimo@kotnet.org>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
---
run-command.c | 1 +
run-command.h | 9 +++++----
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/run-command.c b/run-command.c
index 806af46..d5b8ba2 100644
--- a/run-command.c
+++ b/run-command.c
@@ -150,6 +150,7 @@ static void prepare_run_command_v_opt(struct child_process *cmd,
memset(cmd, 0, sizeof(*cmd));
cmd->argv = argv;
cmd->no_stdin = opt & RUN_COMMAND_NO_STDIN ? 1 : 0;
+ cmd->no_stdout = opt & RUN_COMMAND_NO_STDOUT ? 1 : 0;
cmd->git_cmd = opt & RUN_GIT_CMD ? 1 : 0;
cmd->stdout_to_stderr = opt & RUN_COMMAND_STDOUT_TO_STDERR ? 1 : 0;
cmd->clear_git_env = opt & RUN_COMMAND_CLEAR_GIT_ENV ? 1 : 0;
diff --git a/run-command.h b/run-command.h
index 7724118..e3e897a 100644
--- a/run-command.h
+++ b/run-command.h
@@ -30,10 +30,11 @@ int start_command(struct child_process *);
int finish_command(struct child_process *);
int run_command(struct child_process *);
-#define RUN_COMMAND_NO_STDIN 1
-#define RUN_GIT_CMD 2 /*If this is to be git sub-command */
-#define RUN_COMMAND_STDOUT_TO_STDERR 4
-#define RUN_COMMAND_CLEAR_GIT_ENV (1 << 3)
+#define RUN_COMMAND_NO_STDIN (1 << 0)
+#define RUN_COMMAND_NO_STDOUT (1 << 1)
+#define RUN_GIT_CMD (1 << 2) /* git sub-command */
+#define RUN_COMMAND_STDOUT_TO_STDERR (1 << 3)
+#define RUN_COMMAND_CLEAR_GIT_ENV (1 << 4)
int run_command_v_opt(const char **argv, int opt);
int run_command_v_opt_cd(const char **argv, int opt, const char *dir);
--
1.5.2.784.g5532e