[bug-buddy/remove_breakpad] Run bug-buddy from the handler



commit c28d59121e5083958c430555ba433be4e5d76cfd
Author: Fernando Herrera <fherrera onirica com>
Date:   Mon May 31 15:34:32 2010 +0200

    Run bug-buddy from the handler

 segv_handler/gnome-segvhanlder.c |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/segv_handler/gnome-segvhanlder.c b/segv_handler/gnome-segvhanlder.c
index d6b3954..de64df5 100644
--- a/segv_handler/gnome-segvhanlder.c
+++ b/segv_handler/gnome-segvhanlder.c
@@ -36,11 +36,10 @@
 
 #include <string.h>
 
-const char *g_module_check_init (GModule *module);
-
-int gtk_module_init (int *argc, char** argv[]);
-
-static gboolean    run_bug_buddy   (const gchar *appname, pid_t pid);
+const char         *g_module_check_init (GModule *module);
+int                gtk_module_init      (int *argc, char** argv[]);
+static gboolean    run_bug_buddy        (const gchar *appname, pid_t pid);
+static gboolean    release_grabs        (void);
 
 static gchar *bugbuddy;
 static GLogFunc old_handler = NULL;
@@ -170,6 +169,8 @@ bugbuddy_segv_handle(int signum)
 	static int in_segv = 0;
         struct sigaction sa;
 	pid_t pid;
+	gchar *appname;
+	gboolean res;
 	
 	sa.sa_handler = NULL;
 	in_segv++;
@@ -183,7 +184,15 @@ bugbuddy_segv_handle(int signum)
                 _exit(1);
         }
 
-        _exit(1);
+	release_grabs ();
+
+	appname = g_get_prgname ();
+	pid = getpid ();
+	res = run_bug_buddy (appname, pid);
+	if (!res)
+		_exit (1);
+	
+        _exit(0);
 }
 
 static gboolean



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]