diff: Fix signal handling.

Tyson Dowd trd at stimpy.cs.mu.oz.au
Mon May 18 18:26:00 AEST 1998


Hi,

This should (hopefully) fix the problems with profiling under Linux.

===================================================================


Estimated hours taken: 0.5

Fix some problems with signal setting.

runtime/mercury_signal.c:
runtime/mercury_signal.h:
	- Use Code * instead of void * for the type of signal handlers.
	- Use sigaction if HAVE_SIGACTION is defined, not HAVE_SIGINFO_T.
	- Use SA_SIGINFO only if it is defined.

cvs server: Diffing runtime
Index: runtime/mercury_signal.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_signal.c,v
retrieving revision 1.2
diff -u -t -r1.2 mercury_signal.c
--- mercury_signal.c	1998/05/15 16:39:35	1.2
+++ mercury_signal.c	1998/05/18 08:20:55
@@ -67,15 +67,19 @@
 /*---------------------------------------------------------------------------*/
 
 void
-MR_setup_signal(int sig, void *handler, int need_info, 
+MR_setup_signal(int sig, Code *handler, int need_info, 
                 const char *error_message)
 {
-#if     defined(HAVE_SIGINFO_T)
+#if     defined(HAVE_SIGACTION)
 
         struct sigaction        act;
 
         if (need_info) {
+  #if   defined(SA_SIGINFO)
                 act.sa_flags = SA_SIGINFO | SA_RESTART;
+  #else
+                act.sa_flags = SA_RESTART;
+  #endif
         } else {
                 act.sa_flags = SA_RESTART;
         }
Index: runtime/mercury_signal.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_signal.h,v
retrieving revision 1.1
diff -u -t -r1.1 mercury_signal.h
--- mercury_signal.h	1998/05/14 06:35:16	1.1
+++ mercury_signal.h	1998/05/18 08:20:55
@@ -24,7 +24,7 @@
         ** TRUE.  Note that on some platforms, signal information is
         ** provided regardless of the value of need_info.
         */
-extern void MR_setup_signal(int sig, void *handler, int need_info, 
+extern void MR_setup_signal(int sig, Code *handler, int need_info, 
         const char * error_message);
 
 
cvs server: Diffing runtime/machdeps


-- 
       Tyson Dowd           # So I asked Sarah: what's the serial number on
                            # your computer? She replied:
     trd at cs.mu.oz.au        #          A-C-2-4-0-V-/-5-0-H-Z
http://www.cs.mu.oz.au/~trd #



More information about the developers mailing list