]> granicus.if.org Git - gc/commitdiff
Fix old_segv/bus_act variables initialization for FreeBSD
authorIvan Maidanski <ivmai@mail.ru>
Thu, 22 Aug 2013 06:58:58 +0000 (10:58 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Sun, 25 Aug 2013 18:41:37 +0000 (22:41 +0400)
* os_dep.c (old_segv_act): Define static variable for FREEBSD (same as
for NETBSD).
* os_dep.c (GC_set_and_save_fault_handler): Reformat code (related to
FreeBSD).
* os_dep.c (GC_reset_fault_handler): Initialize old_segv_act (and
old_bus_act) for FREEBSD (same as for NETBSD).

os_dep.c

index 08cf47eee47957d20a4d43fbf6afc068a05d47a4..2730205dcf20e0570f20bed8da5b3c5f1ede08b3 100644 (file)
--- a/os_dep.c
+++ b/os_dep.c
@@ -844,7 +844,7 @@ GC_INNER word GC_page_size = 0;
     typedef void (*GC_fault_handler_t)(int);
 
 #   if defined(SUNOS5SIGS) || defined(IRIX5) || defined(OSF1) \
-       || defined(HURD) || defined(NETBSD)
+       || defined(HURD) || defined(FREEBSD) || defined(NETBSD)
         static struct sigaction old_segv_act;
 #       if defined(_sigargs) /* !Irix6.x */ \
            || defined(HURD) || defined(NETBSD) || defined(FREEBSD)
@@ -859,8 +859,8 @@ GC_INNER word GC_page_size = 0;
 
     GC_INNER void GC_set_and_save_fault_handler(GC_fault_handler_t h)
     {
-#       if defined(SUNOS5SIGS) || defined(IRIX5) \
-           || defined(OSF1) || defined(HURD) || defined(NETBSD) || defined(FREEBSD)
+#       if defined(SUNOS5SIGS) || defined(IRIX5) || defined(OSF1) \
+            || defined(HURD) || defined(FREEBSD) || defined(NETBSD)
           struct sigaction act;
 
           act.sa_handler = h;
@@ -888,7 +888,7 @@ GC_INNER word GC_page_size = 0;
               /* don't have to worry in the threads case.       */
               (void) sigaction(SIGBUS, &act, &old_bus_act);
 #           endif
-#         endif /* GC_IRIX_THREADS */
+#         endif /* !GC_IRIX_THREADS */
 #       else
           old_segv_handler = signal(SIGSEGV, h);
 #         ifdef SIGBUS
@@ -918,8 +918,8 @@ GC_INNER word GC_page_size = 0;
 
     GC_INNER void GC_reset_fault_handler(void)
     {
-#       if defined(SUNOS5SIGS) || defined(IRIX5) \
-           || defined(OSF1) || defined(HURD) || defined(NETBSD)
+#       if defined(SUNOS5SIGS) || defined(IRIX5) || defined(OSF1) \
+           || defined(HURD) || defined(FREEBSD) || defined(NETBSD)
           (void) sigaction(SIGSEGV, &old_segv_act, 0);
 #         if defined(IRIX5) && defined(_sigargs) /* Irix 5.x, not 6.x */ \
              || defined(HURD) || defined(NETBSD)