summaryrefslogtreecommitdiff
path: root/transport-helper.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 /transport-helper.c
parentd3180279322c7450a47decf8833de47f444ca93f (diff)
downloadgit-483bbd4e4ce8a5c717cd47d732893317a14c965a.tar.gz
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 'transport-helper.c')
-rw-r--r--transport-helper.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/transport-helper.c b/transport-helper.c
index 3d8fe7d801..080a7a6ae2 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");