Jacob has pointed out why SIGCHLD was blocked, so I've updated the
[sgt/putty] / unix / signal.c
index 4e103b7..9b0ad5e 100644 (file)
@@ -1,4 +1,6 @@
 #include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
 
 /*
  * Calling signal() is a non-portable, as it varies in meaning between
@@ -23,6 +25,18 @@ void (*putty_signal(int sig, void (*func)(int)))(int) {
     return old.sa_handler;
 }
 
+void block_signal(int sig, int block_it)
+{
+    sigset_t ss;
+
+    sigemptyset(&ss);
+    sigaddset(&ss, sig);
+    if(sigprocmask(block_it ? SIG_BLOCK : SIG_UNBLOCK, &ss, 0) < 0) {
+       perror("sigprocmask");
+       exit(1);
+    }
+}
+
 /*
 Local Variables:
 c-basic-offset:4