From 483bbd4e4ce8a5c717cd47d732893317a14c965a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Tue, 19 Aug 2014 21:10:48 +0200 Subject: 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 Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- run-command.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'run-command.c') 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; -- cgit v1.2.1