This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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);
 	}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]