]> spindle.queued.net Git - midori/commitdiff
Use only signals which are defined, since not all are portable
authorPeter de Ridder <peter@xfce.org>
Tue, 17 Nov 2009 17:57:32 +0000 (18:57 +0100)
committerChristian Dywan <christian@twotoasts.de>
Tue, 17 Nov 2009 18:18:14 +0000 (19:18 +0100)
For instance Windows has support for unix signals but only for
some of the signals.

midori/main.c

index 28fd87fd2c6c3ddc6625c7e216a46691d5e01942..88958bb9698805ee9370579ce1265d474251260c 100644 (file)
@@ -1580,12 +1580,8 @@ midori_remove_config_file (gint         clear_prefs,
 static void
 signal_handler (int signal_id)
 {
-    if (signal_id == SIGHUP || signal_id == SIGINT
-     || signal_id == SIGTERM || signal_id == SIGQUIT)
-    {
-        midori_app_quit_cb (NULL);
-        gtk_main_quit ();
-    }
+    midori_app_quit_cb (NULL);
+    gtk_main_quit ();
 }
 #endif
 
@@ -1664,11 +1660,19 @@ main (int    argc,
     #endif
 
     #ifdef HAVE_SIGNAL_H
+    #ifdef SIGHUP
     signal (SIGHUP, &signal_handler);
+    #endif
+    #ifdef SIGINT
     signal (SIGINT, &signal_handler);
+    #endif
+    #ifdef SIGTERM
     signal (SIGTERM, &signal_handler);
+    #endif
+    #ifdef SIGQUIT
     signal (SIGQUIT, &signal_handler);
     #endif
+    #endif
 
     /* Parse cli options */
     webapp = NULL;