Permalink
Browse files

Avoid zombie processes from child processes

  • Loading branch information...
1 parent 8de966f commit 2342a472a1226ff8699b289cba0fb487ed208087 @c2nes committed with mbrown1413 Mar 10, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/main.c
View
8 src/main.c
@@ -4,6 +4,14 @@
int main(int argc, char** argv) {
CTerm term;
GtkRcStyle* style;
+ struct sigaction ignore_children;
+
+ /* Avoid zombies when executing external programs by explicitly setting the
+ handler to SIG_IGN */
+ ignore_children.sa_handler = SIG_IGN;
+ ignore_children.sa_flags = 0;
+ sigemptyset(&ignore_children.sa_mask);
+ sigaction(SIGCHLD, &ignore_children, NULL);
/* Initialize GTK */
gtk_init(&argc, &argv);

0 comments on commit 2342a47

Please sign in to comment.