[Spice-commits] gtk/spicy.c

Marc-André Lureau elmarco at kemper.freedesktop.org
Tue May 12 08:42:03 PDT 2015


 gtk/spicy.c |   45 ---------------------------------------------
 1 file changed, 45 deletions(-)

New commits:
commit 495e5b6fe0218b779c3670fed4f75e9f8f92c628
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Wed May 6 17:25:35 2015 +0200

    spicy: remove useless signal handlers
    
    There is no strong reason to have signal handlers in spicy (a test
    tool). Clean quit can be achieved through the File/Quit menu.
    
    Fixes:
    https://bugzilla.redhat.com/show_bug.cgi?id=1197175

diff --git a/gtk/spicy.c b/gtk/spicy.c
index 4bc6ddb..9cd6ee5 100644
--- a/gtk/spicy.c
+++ b/gtk/spicy.c
@@ -1699,40 +1699,6 @@ static GOptionEntry cmd_entries[] = {
     }
 };
 
-static void (* segv_handler) (int) = SIG_DFL;
-static void (* abrt_handler) (int) = SIG_DFL;
-static void (* fpe_handler)  (int) = SIG_DFL;
-static void (* ill_handler)  (int) = SIG_DFL;
-#ifndef G_OS_WIN32
-static void (* bus_handler)  (int) = SIG_DFL;
-#endif
-
-static void
-signal_handler(int signum)
-{
-    static gint recursion = FALSE;
-
-    /*
-     * reset all signal handlers: any further crashes should just be allowed
-     * to crash normally.
-     * */
-    signal(SIGSEGV, segv_handler);
-    signal(SIGABRT, abrt_handler);
-    signal(SIGFPE,  fpe_handler);
-    signal(SIGILL,  ill_handler);
-#ifndef G_OS_WIN32
-    signal(SIGBUS,  bus_handler);
-#endif
-
-    /* Stop bizarre loops */
-    if (recursion)
-        abort ();
-
-    recursion = TRUE;
-
-    g_main_loop_quit(mainloop);
-}
-
 static void usb_connect_failed(GObject               *object,
                                SpiceUsbDevice        *device,
                                GError                *error,
@@ -1801,17 +1767,6 @@ int main(int argc, char *argv[])
     bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
     textdomain(GETTEXT_PACKAGE);
 
-    signal(SIGINT, signal_handler);
-    signal(SIGTERM, signal_handler);
-    segv_handler = signal(SIGSEGV, signal_handler);
-    abrt_handler = signal(SIGABRT, signal_handler);
-    fpe_handler  = signal(SIGFPE,  signal_handler);
-    ill_handler  = signal(SIGILL,  signal_handler);
-#ifndef G_OS_WIN32
-    signal(SIGHUP, signal_handler);
-    bus_handler  = signal(SIGBUS,  signal_handler);
-#endif
-
     keyfile = g_key_file_new();
 
     int mode = S_IRWXU;


More information about the Spice-commits mailing list