1 /jds/bin/diff -uprN bug-buddy-2.25.2.old/gnome-breakpad/gnome-breakpad.cc bug-buddy-2.25.2/gnome-breakpad/gnome-breakpad.cc 2 --- bug-buddy-2.25.2.old/gnome-breakpad/gnome-breakpad.cc 2008-12-11 12:57:57.762310000 +0000 3 +++ bug-buddy-2.25.2/gnome-breakpad/gnome-breakpad.cc 2008-12-11 13:11:10.651856000 +0000 4 @@ -32,6 +32,7 @@ 5 #include <sys/stat.h> 6 #include <fcntl.h> 7 #include <signal.h> 8 +#include <dlfcn.h> 9 #include <sys/wait.h> 10 11 #include <glib.h> 12 @@ -494,6 +495,7 @@ check_if_gdb () 13 int 14 gtk_module_init (int *argc, char** argv[]) 15 { 16 + void *handle; 17 bugbuddy = g_find_program_in_path ("bug-buddy"); 18 19 if (bugbuddy && !g_getenv ("GNOME_DISABLE_CRASH_DIALOG")) { 20 @@ -503,35 +505,40 @@ gtk_module_init (int *argc, char** argv[ 21 NULL, NULL, false); 22 #endif 23 24 - static struct sigaction *setptr; 25 - static struct sigaction old_action; 26 - struct sigaction sa; 27 + static struct sigaction *setptr; 28 + static struct sigaction old_action; 29 + struct sigaction sa; 30 memset(&sa, 0, sizeof(sa)); 31 setptr = &sa; 32 33 - sa.sa_handler = bugbuddy_segv_handle; 34 + sa.sa_handler = bugbuddy_segv_handle; 35 36 - sigaction(SIGSEGV, NULL, &old_action); 37 - if (old_action.sa_handler == SIG_DFL) 38 - sigaction(SIGSEGV, setptr, NULL); 39 - 40 - sigaction(SIGABRT, NULL, &old_action); 41 - if (old_action.sa_handler == SIG_DFL) 42 - sigaction(SIGABRT, setptr, NULL); 43 - 44 - sigaction(SIGTRAP, NULL, &old_action); 45 - if (old_action.sa_handler == SIG_DFL) 46 - sigaction(SIGTRAP, setptr, NULL); 47 - 48 - sigaction(SIGFPE, NULL, &old_action); 49 - if (old_action.sa_handler == SIG_DFL) 50 - sigaction(SIGFPE, setptr, NULL); 51 - 52 - sigaction(SIGBUS, NULL, &old_action); 53 - if (old_action.sa_handler == SIG_DFL) 54 - sigaction(SIGBUS, setptr, NULL); 55 + if ((handle = dlopen ("libjsig.so", RTLD_LAZY)) == NULL) { 56 + sigaction(SIGSEGV, NULL, &old_action); 57 + if (old_action.sa_handler == SIG_DFL) 58 + sigaction(SIGSEGV, setptr, NULL); 59 + 60 + sigaction(SIGABRT, NULL, &old_action); 61 + if (old_action.sa_handler == SIG_DFL) 62 + sigaction(SIGABRT, setptr, NULL); 63 + 64 + sigaction(SIGTRAP, NULL, &old_action); 65 + if (old_action.sa_handler == SIG_DFL) 66 + sigaction(SIGTRAP, setptr, NULL); 67 + 68 + sigaction(SIGFPE, NULL, &old_action); 69 + if (old_action.sa_handler == SIG_DFL) 70 + sigaction(SIGFPE, setptr, NULL); 71 + 72 + sigaction(SIGBUS, NULL, &old_action); 73 + if (old_action.sa_handler == SIG_DFL) 74 + sigaction(SIGBUS, setptr, NULL); 75 + 76 + old_handler = g_log_set_default_handler (bug_buddy_log_handler, NULL); 77 + } else { 78 + dlclose (handle); 79 + } 80 81 - old_handler = g_log_set_default_handler (bug_buddy_log_handler, NULL); 82 } 83 return 0; 84 } 85