1 --- bug-buddy-2.24.0.old/gnome-breakpad/gnome-breakpad.cc 2008-09-23 17:47:18.455189000 +0100 2 +++ bug-buddy-2.24.0/gnome-breakpad/gnome-breakpad.cc 2008-09-23 17:52:37.965253000 +0100 3 @@ -13,6 +13,7 @@ 4 #include <sys/stat.h> 5 #include <fcntl.h> 6 #include <signal.h> 7 +#include <dlfcn.h> 8 #include <sys/wait.h> 9 10 #include <glib.h> 11 @@ -346,6 +347,7 @@ 12 int 13 gtk_module_init (int *argc, char** argv[]) 14 { 15 + void *handle; 16 bugbuddy = g_find_program_in_path ("bug-buddy"); 17 18 if (bugbuddy && !g_getenv ("GNOME_DISABLE_CRASH_DIALOG")) { 19 @@ -363,25 +365,29 @@ 20 21 sa.sa_handler = bugbuddy_segv_handle; 22 23 - sigaction(SIGSEGV, NULL, &old_action); 24 - if (old_action.sa_handler == SIG_DFL) 25 - sigaction(SIGSEGV, setptr, NULL); 26 - 27 - sigaction(SIGABRT, NULL, &old_action); 28 - if (old_action.sa_handler == SIG_DFL) 29 - sigaction(SIGABRT, setptr, NULL); 30 - 31 - sigaction(SIGTRAP, NULL, &old_action); 32 - if (old_action.sa_handler == SIG_DFL) 33 - sigaction(SIGTRAP, setptr, NULL); 34 - 35 - sigaction(SIGFPE, NULL, &old_action); 36 - if (old_action.sa_handler == SIG_DFL) 37 - sigaction(SIGFPE, setptr, NULL); 38 - 39 - sigaction(SIGBUS, NULL, &old_action); 40 - if (old_action.sa_handler == SIG_DFL) 41 - sigaction(SIGBUS, setptr, NULL); 42 + if ((handle = dlopen ("libjsig.so", RTLD_LAZY)) == NULL) { 43 + sigaction(SIGSEGV, NULL, &old_action); 44 + if (old_action.sa_handler == SIG_DFL) 45 + sigaction(SIGSEGV, setptr, NULL); 46 + 47 + sigaction(SIGABRT, NULL, &old_action); 48 + if (old_action.sa_handler == SIG_DFL) 49 + sigaction(SIGABRT, setptr, NULL); 50 + 51 + sigaction(SIGTRAP, NULL, &old_action); 52 + if (old_action.sa_handler == SIG_DFL) 53 + sigaction(SIGTRAP, setptr, NULL); 54 + 55 + sigaction(SIGFPE, NULL, &old_action); 56 + if (old_action.sa_handler == SIG_DFL) 57 + sigaction(SIGFPE, setptr, NULL); 58 + 59 + sigaction(SIGBUS, NULL, &old_action); 60 + if (old_action.sa_handler == SIG_DFL) 61 + sigaction(SIGBUS, setptr, NULL); 62 + } else { 63 + dlclose (handle); 64 + } 65 } 66 return 0; 67 } 68