summaryrefslogtreecommitdiff
path: root/run-command.h
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-03-10 03:28:00 -0500
committerJunio C Hamano <junkio@cox.net>2007-03-11 22:49:34 -0700
commitf1000898d43a30f6a0d3bbde7b4927e97913d010 (patch)
tree0e3b57faeb21bef705f753382f3f6867ab62431e /run-command.h
parentafdb269c76cb965cf8bbb1012c2ec0e2bf7172b1 (diff)
downloadgit-f1000898d43a30f6a0d3bbde7b4927e97913d010.tar.gz
Start defining a more sophisticated run_command
There are a number of places where we do some variation of fork()+exec() but we also need to setup redirection in the process, much like what run_command does for us already with its option flags. It would be nice to reuse more of the run_command logic, especially as that non-fork API helps us to port to odd platforms like Win32. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'run-command.h')
-rw-r--r--run-command.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/run-command.h b/run-command.h
index 2646d38ac7..f9db2a7f8c 100644
--- a/run-command.h
+++ b/run-command.h
@@ -10,6 +10,15 @@ enum {
ERR_RUN_COMMAND_WAITPID_NOEXIT,
};
+struct child_process {
+ const char **argv;
+ unsigned no_stdin:1;
+ unsigned git_cmd:1; /* if this is to be git sub-command */
+ unsigned stdout_to_stderr:1;
+};
+
+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