aboutsummaryrefslogtreecommitdiff
path: root/run-command.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2014-08-19 21:10:48 +0200
committerJunio C Hamano <gitster@pobox.com>2014-08-20 09:54:58 -0700
commit483bbd4e4ce8a5c717cd47d732893317a14c965a (patch)
tree65987463920d8dfe402f8abdc7febbb62332d30b /run-command.c
parentd3180279322c7450a47decf8833de47f444ca93f (diff)
downloadgit-483bbd4e4ce8a5c717cd47d732893317a14c965a.tar.gz
git-483bbd4e4ce8a5c717cd47d732893317a14c965a.tar.xz
run-command: introduce child_process_init()
Add a helper function for initializing those struct child_process variables for which the macro CHILD_PROCESS_INIT can't be used. Suggested-by: Jeff King <peff@peff.net> Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'run-command.c')
-rw-r--r--run-command.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/run-command.c b/run-command.c
index a29a34fb1..47ab21bcc 100644
--- a/run-command.c
+++ b/run-command.c
@@ -8,6 +8,12 @@
# define SHELL_PATH "/bin/sh"
#endif
+void child_process_init(struct child_process *child)
+{
+ memset(child, 0, sizeof(*child));
+ argv_array_init(&child->args);
+}
+
struct child_to_clean {
pid_t pid;
struct child_to_clean *next;