From 3da609588ad6fe7eb0581e4678a2ec8c6c1c4a18 Mon Sep 17 00:00:00 2001
From: Stijn Buys <ingar@osirion.org>
Date: Thu, 31 Jul 2008 12:43:43 +0000
Subject: more heisenbugs fixes

---
 src/sys/sys.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'src/sys')

diff --git a/src/sys/sys.cc b/src/sys/sys.cc
index 10b7897..da9b08d 100644
--- a/src/sys/sys.cc
+++ b/src/sys/sys.cc
@@ -13,6 +13,7 @@
 
 #include <unistd.h>
 #include <signal.h>
+#include <string.h>
 #include <sys/time.h>
 #include <sys/stat.h>
 #include <sys/types.h>
@@ -46,8 +47,10 @@ void signal(int signum, signalfunc handler)
 #ifndef _WIN32
 	struct sigaction sa;
 
-	sa.sa_handler = handler;
+	sa.sa_sigaction = 0;
+	memset(&sa.sa_mask, 0 ,sizeof(sigset_t));
 	sa.sa_flags = 0;
+	sa.sa_handler = handler;
 
 	::sigaction(signum, &sa, 0);
 #endif
-- 
cgit v1.2.3