Thread (11 messages) flat view 11 messages, 4 authors, 2016-06-15

Re: [PATCH 1/5] run-command: optionally kill children on exit

From: Erik Faye-Lund <hidden>
Date: 2016-06-15 22:52:44

On Sat, Jan 7, 2012 at 12:42 PM, Clemens Buchacher [off-list ref] wrote:
+static void cleanup_children(int sig)
+{
+       while (children_to_clean) {
+               struct child_to_clean *p = children_to_clean;
+               children_to_clean = p->next;
+               kill(p->pid, sig);
+               free(p);
+       }
+}
+
+static void cleanup_children_on_signal(int sig)
+{
+       cleanup_children(sig);
+       sigchain_pop(sig);
+       raise(sig);
+}
+
Our Windows implementation of kill (mingw_kill in compat/mingw.c) only
supports SIGKILL, so propagating other signals to child-processes will
fail with EINVAL. That being said, Windows' support for signals is
severely limited, but I'm not entirely sure which ones can be
generated in this case.
quoted hunk ↗ jump to hunk
@@ -312,6 +375,7 @@ fail_pipe:
               cmd->pid = -1;
       }
       close(notify_pipe[0]);
+
 }
 #else
 {
This hunk is probably unintentional...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help