[Xfce4-commits] <midori:master> Use only signals which are defined, since not all are portable

Christian Dywan noreply at xfce.org
Tue Nov 17 19:22:07 CET 2009


Updating branch refs/heads/master
         to ba70a6fd5ab2b2278c3a5c6984911043bc5f3e9c (commit)
       from 3fc0c192fd13eee9e62ae3c92a1c1c27a5452dc4 (commit)

commit ba70a6fd5ab2b2278c3a5c6984911043bc5f3e9c
Author: Peter de Ridder <peter at xfce.org>
Date:   Tue Nov 17 18:57:32 2009 +0100

    Use only signals which are defined, since not all are portable
    
    For instance Windows has support for unix signals but only for
    some of the signals.

 midori/main.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/midori/main.c b/midori/main.c
index 28fd87f..88958bb 100644
--- a/midori/main.c
+++ b/midori/main.c
@@ -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;



More information about the Xfce4-commits mailing list