Permalink
Browse files

change signalling of child to pgid

to fix dash
  • Loading branch information...
1 parent 0c057ff commit 6a1624f96116d558bd94f55be23b3e3554712ea9 @tj committed Nov 10, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/mon.c
View
@@ -89,15 +89,17 @@ alive(pid_t pid) {
}
/*
- * Graceful exit, signal child.
+ * Graceful exit, signal process group.
*/
void
graceful_exit(int sig) {
+ pid_t pid = getpid();
log("shutting down");
- log("kill(%d, %d)", sig, pid);
- kill(pid, SIGKILL);
- exit(1);
+ log("kill(-%d, %d)", pid, sig);
+ kill(-pid, SIGKILL);
+ log("bye :)");
+ exit(0);
}
/*

0 comments on commit 6a1624f

Please sign in to comment.