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.
This commit is contained in:
Peter de Ridder 2009-11-17 18:57:32 +01:00 committed by Christian Dywan
parent 3fc0c192fd
commit ba70a6fd5a

View file

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