Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > a7566b13192fa881d4a65fa4250d3d54 > files > 2

gamin-0.1.7-10.el5.src.rpm

diff -urN gamin-0.1.7/lib/gam_error.c /gnome/head/cvs/gamin/lib/gam_error.c
--- gamin-0.1.7/lib/gam_error.c	2005-09-08 09:46:45.000000000 +0200
+++ /gnome/head/cvs/gamin/lib/gam_error.c	2006-06-01 11:59:14.000000000 +0200
@@ -76,7 +76,7 @@
 gam_error_init(void)
 {
     if (initialized == 0) {
-        signal_handler prev;
+        struct sigaction oldact;
 
         initialized = 1;
 
@@ -89,11 +89,12 @@
             gam_error_handle_signal();
         }
 
-        prev = signal(SIGUSR2, gam_error_signal);
-        /* if there is already an handler switch back to the original
-         * to avoid disturbing the application behaviour */
-        if ((prev != SIG_IGN) && (prev != SIG_DFL) && (prev != NULL))
-            signal(SIGUSR2, prev);
+	/* if there is already an handler, leave it as is to
+	 * avoid disturbing the application's behaviour */
+	if (sigaction (SIGUSR2, NULL, &oldact) == 0) {
+	    if (oldact.sa_handler == NULL && oldact.sa_sigaction == NULL)
+	        signal(SIGUSR2, gam_error_signal);
+	}
     }
 }
 
diff -urN gamin-0.1.7/libgamin/gam_error.c /gnome/head/cvs/gamin/libgamin/gam_error.c
--- gamin-0.1.7/libgamin/gam_error.c	2005-10-25 16:16:51.000000000 +0200
+++ /gnome/head/cvs/gamin/libgamin/gam_error.c	2006-06-01 12:00:09.000000000 +0200
@@ -76,7 +76,7 @@
 gam_error_init(void)
 {
     if (initialized == 0) {
-        signal_handler prev;
+        struct sigaction oldact;
 
         initialized = 1;
 
@@ -89,11 +89,12 @@
             gam_error_handle_signal();
         }
 
-        prev = signal(SIGUSR2, gam_error_signal);
-        /* if there is already an handler switch back to the original
-         * to avoid disturbing the application behaviour */
-        if ((prev != SIG_IGN) && (prev != SIG_DFL) && (prev != NULL))
-            signal(SIGUSR2, prev);
+	/* if there is already an handler, leave it as is to
+	 * avoid disturbing the application's behaviour */
+	if (sigaction (SIGUSR2, NULL, &oldact) == 0) {
+	    if (oldact.sa_handler == NULL && oldact.sa_sigaction == NULL)
+	        signal(SIGUSR2, gam_error_signal);
+	}
     }
 }