Admin/bash_process/bash_process.c
changeset 62575 590df5f4e531
parent 62568 3541bc1e97d2
child 73599 981df2e1f646
--- a/Admin/bash_process/bash_process.c	Wed Mar 09 19:52:17 2016 +0100
+++ b/Admin/bash_process/bash_process.c	Wed Mar 09 20:11:25 2016 +0100
@@ -3,6 +3,7 @@
 Bash process with separate process group id.
 */
 
+#include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -56,6 +57,12 @@
     else if (pid != 0) {
       int status;
 
+      // ingore SIGINT
+      struct sigaction sa;
+      memset(&sa, 0, sizeof(sa));
+      sa.sa_handler = SIG_IGN;
+      sigaction(SIGINT, &sa, 0);
+
       if (waitpid(pid, &status, 0) == -1) {
         fail("Cannot join forked process");
       }