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 --- transport-helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'transport-helper.c') diff --git a/transport-helper.c b/transport-helper.c index 3d8fe7d80..080a7a6ae 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -118,7 +118,8 @@ static struct child_process *get_helper(struct transport *transport) if (data->helper) return data->helper; - helper = xcalloc(1, sizeof(*helper)); + helper = xmalloc(sizeof(*helper)); + child_process_init(helper); helper->in = -1; helper->out = -1; helper->err = 0; @@ -395,7 +396,7 @@ static int get_importer(struct transport *transport, struct child_process *fasti struct child_process *helper = get_helper(transport); struct helper_data *data = transport->data; int cat_blob_fd, code; - memset(fastimport, 0, sizeof(*fastimport)); + child_process_init(fastimport); fastimport->in = helper->out; argv_array_push(&fastimport->args, "fast-import"); argv_array_push(&fastimport->args, debug ? "--stats" : "--quiet"); -- cgit v1.2.1