diff options
author | Dan Williams <dcbw@redhat.com> | 2010-03-09 09:55:04 -0800 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2010-03-09 09:55:04 -0800 |
commit | 783de3bc10ba8b6fe934887efaeb229da6ad9d06 (patch) | |
tree | ba702d3fca98716a2ea20905ad7911e82fe999b4 /src/main.c | |
parent | 9e231c3d4b463c32e17c7d2b1c50cea4e19d03ac (diff) | |
download | ModemManager-783de3bc10ba8b6fe934887efaeb229da6ad9d06.tar.gz |
core: fix SIGTERM before mainloop has started
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c index 366911504..916acb362 100644 --- a/src/main.c +++ b/src/main.c @@ -17,6 +17,7 @@ #include <signal.h> #include <syslog.h> #include <string.h> +#include <unistd.h> #include <dbus/dbus-glib.h> #include <dbus/dbus-glib-lowlevel.h> #include "mm-manager.h" @@ -33,8 +34,11 @@ mm_signal_handler (int signo) mm_options_set_debug (!mm_options_debug ()); else if (signo == SIGINT || signo == SIGTERM) { g_message ("Caught signal %d, shutting down...", signo); - g_main_loop_quit (loop); - } + if (loop) + g_main_loop_quit (loop); + else + _exit (0); + } } static void |