This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gccgo] Initialize struct sigaction properly
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 23 Dec 2009 15:33:15 -0800
- Subject: [gccgo] Initialize struct sigaction properly
I committed this patch to the gccgo branch to properly initialize a
struct sigaction when removing a signal handler in order to get the
default behaviour.
Ian
Index: libgo/runtime/go-signal.c
===================================================================
--- libgo/runtime/go-signal.c (revision 155391)
+++ libgo/runtime/go-signal.c (working copy)
@@ -97,8 +97,15 @@ sighandler (int sig)
return;
memset (&sa, 0, sizeof sa);
+
+ sa.sa_handler = SIG_DFL;
+
+ i = sigemptyset (&sa.sa_mask);
+ assert (i == 0);
+
if (sigaction (sig, &sa, NULL) != 0)
abort ();
+
raise (sig);
exit (2);
}