git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] run-command.c: ensure signaled hook scripts are waited upon
@ 2020-02-21  6:06 Anthony Sottile
  2020-02-21  6:39 ` Jeff King
  0 siblings, 1 reply; 3+ messages in thread
From: Anthony Sottile @ 2020-02-21  6:06 UTC (permalink / raw)
  To: git; +Cc: Anthony Sottile

In the event of a `^C` while hook scripts are running, ensure that the
hook processes are cleaned up and do not become zombies.  This also ensures
that upon `^C` execution is not handed back to the terminal until the
processes have been waited upon.

Signed-off-by: Anthony Sottile <asottile@umich.edu>
---
 run-command.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/run-command.c b/run-command.c
index f5e1149..75d3b73 100644
--- a/run-command.c
+++ b/run-command.c
@@ -1358,6 +1358,8 @@ int run_hook_ve(const char *const *env, const char *name, va_list args)
 	hook.no_stdin = 1;
 	hook.stdout_to_stderr = 1;
 	hook.trace2_hook_name = name;
+	hook.clean_on_exit = 1;
+	hook.wait_after_clean = 1;
 
 	return run_command(&hook);
 }
-- 
2.25.GIT


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-02-22 17:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-21  6:06 [PATCH] run-command.c: ensure signaled hook scripts are waited upon Anthony Sottile
2020-02-21  6:39 ` Jeff King
2020-02-22 17:12   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).