diff --git a/src/prestwood-main.c b/src/prestwood-main.c index 48f6880445fce241bec021f85b846d10065e2b7d..671415ee743c4575649ff8df3736dfbaf78f8f95 100644 --- a/src/prestwood-main.c +++ b/src/prestwood-main.c @@ -14,42 +14,15 @@ #include <stdlib.h> #include <glib.h> -static void prestwood_cleanup (void) -{ -} - -static void prestwood_exit (gint status) -{ - exit (status); -} - -static void prestwood_handle_exit (void) -{ - struct sigaction action; - action.sa_handler = prestwood_exit; - action.sa_flags = 0; - sigaction (SIGINT, &action, NULL); - sigaction (SIGHUP, &action, NULL); - sigaction (SIGTERM, &action, NULL); - atexit (prestwood_cleanup); -} - -static void prestwood_initialize (void) -{ - if (prestwood_init () != 0) - prestwood_exit (-1); -} - - gint main (gint argc, gchar **argv) { - prestwood_handle_exit(); GMainLoop *mainloop = g_main_loop_new (NULL, TRUE); if (mainloop == NULL) return -1; - prestwood_initialize (); + if (prestwood_init () != 0) + return -1; mainloop = g_main_loop_new (NULL, FALSE); g_main_loop_run (mainloop);