summaryrefslogtreecommitdiff
path: root/daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'daemon.c')
-rw-r--r--daemon.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/daemon.c b/daemon.c
index 8df21f2130..4a000ee4af 100644
--- a/daemon.c
+++ b/daemon.c
@@ -326,22 +326,18 @@ static int run_access_hook(struct daemon_service *service, const char *dir,
{
struct child_process child = CHILD_PROCESS_INIT;
struct strbuf buf = STRBUF_INIT;
- const char *argv[8];
- const char **arg = argv;
char *eol;
int seen_errors = 0;
- *arg++ = access_hook;
- *arg++ = service->name;
- *arg++ = path;
- *arg++ = hi->hostname.buf;
- *arg++ = get_canon_hostname(hi);
- *arg++ = get_ip_address(hi);
- *arg++ = hi->tcp_port.buf;
- *arg = NULL;
+ strvec_push(&child.args, access_hook);
+ strvec_push(&child.args, service->name);
+ strvec_push(&child.args, path);
+ strvec_push(&child.args, hi->hostname.buf);
+ strvec_push(&child.args, get_canon_hostname(hi));
+ strvec_push(&child.args, get_ip_address(hi));
+ strvec_push(&child.args, hi->tcp_port.buf);
child.use_shell = 1;
- child.argv = argv;
child.no_stdin = 1;
child.no_stderr = 1;
child.out = -1;