Skip to content

Commit c6c7e98

Browse files
committed
Merge branch 'aa/reap-transport-child-processes' into seen
A few code paths that spawned child processes for network connection weren't wait(2)ing for their children and letting "init" reap them instead; they have been tightened. * aa/reap-transport-child-processes: transport-helper, connect: use clean_on_exit to reap children on abnormal exit
2 parents e86b5cd + dd3693e commit c6c7e98

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

connect.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,6 +1054,8 @@ static struct child_process *git_proxy_connect(int fd[2], char *host)
10541054
strvec_push(&proxy->args, port);
10551055
proxy->in = -1;
10561056
proxy->out = -1;
1057+
proxy->clean_on_exit = 1;
1058+
proxy->wait_after_clean = 1;
10571059
if (start_command(proxy))
10581060
die(_("cannot start proxy %s"), git_proxy_command);
10591061
fd[0] = proxy->out; /* read from proxy stdout */
@@ -1515,6 +1517,8 @@ struct child_process *git_connect(int fd[2], const char *url,
15151517
}
15161518
strvec_push(&conn->args, cmd.buf);
15171519

1520+
conn->clean_on_exit = 1;
1521+
conn->wait_after_clean = 1;
15181522
if (start_command(conn))
15191523
die(_("unable to fork"));
15201524

transport-helper.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ static struct child_process *get_helper(struct transport *transport)
154154

155155
helper->trace2_child_class = helper->args.v[0]; /* "remote-<name>" */
156156

157+
helper->clean_on_exit = 1;
158+
helper->wait_after_clean = 1;
157159
code = start_command(helper);
158160
if (code < 0 && errno == ENOENT)
159161
die(_("unable to find remote helper for '%s'"), data->name);

0 commit comments

Comments
 (0)