summaryrefslogtreecommitdiff
path: root/connect.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 /connect.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 'connect.c')
-rw-r--r--connect.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/connect.c b/connect.c
index f5b930a269..87b5202632 100644
--- a/connect.c
+++ b/connect.c
@@ -537,7 +537,8 @@ static struct child_process *git_proxy_connect(int fd[2], char *host)
get_host_and_port(&host, &port);
- proxy = xcalloc(1, sizeof(*proxy));
+ proxy = xmalloc(sizeof(*proxy));
+ child_process_init(proxy);
argv_array_push(&proxy->args, git_proxy_command);
argv_array_push(&proxy->args, host);
argv_array_push(&proxy->args, port);
@@ -694,7 +695,8 @@ struct child_process *git_connect(int fd[2], const char *url,
target_host, 0);
free(target_host);
} else {
- conn = xcalloc(1, sizeof(*conn));
+ conn = xmalloc(sizeof(*conn));
+ child_process_init(conn);
strbuf_addstr(&cmd, prog);
strbuf_addch(&cmd, ' ');