diff options
author | Tor Lillqvist <tml@iki.fi> | 2008-09-18 19:40:50 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2009-01-06 18:21:25 -0500 |
commit | 100027007254aaec3ba0388bd0f42e29e512a678 (patch) | |
tree | 4c373f33fec565b4fd0d07d4dce8667f761454c3 | |
parent | fc08b432a3df4e3ebb5f5f33ae8d0850aed5f996 (diff) |
[win32] Protect usage of SIGHUP with #ifdef
Signed-off-by: Colin Walters <walters@verbum.org>
-rw-r--r-- | bus/main.c | 23 | ||||
-rw-r--r-- | tools/dbus-launch.c | 2 |
2 files changed, 16 insertions, 9 deletions
@@ -44,7 +44,6 @@ static void close_reload_pipe (void); static void signal_handler (int sig) { - DBusString str; switch (sig) { @@ -52,16 +51,20 @@ signal_handler (int sig) case SIGIO: /* explicit fall-through */ #endif /* DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX */ +#ifdef SIGHUP case SIGHUP: - _dbus_string_init_const (&str, "foo"); - if ((reload_pipe[RELOAD_WRITE_END] > 0) && - !_dbus_write_socket (reload_pipe[RELOAD_WRITE_END], &str, 0, 1)) - { - _dbus_warn ("Unable to write to reload pipe.\n"); - close_reload_pipe (); - } + { + DBusString str; + _dbus_string_init_const (&str, "foo"); + if ((reload_pipe[RELOAD_WRITE_END] > 0) && + !_dbus_write_socket (reload_pipe[RELOAD_WRITE_END], &str, 0, 1)) + { + _dbus_warn ("Unable to write to reload pipe.\n"); + close_reload_pipe (); + } + } break; - +#endif case SIGTERM: _dbus_loop_quit (bus_context_get_loop (context)); break; @@ -458,7 +461,9 @@ main (int argc, char **argv) setup_reload_pipe (bus_context_get_loop (context)); +#ifdef SIGHUP _dbus_set_signal_handler (SIGHUP, signal_handler); +#endif _dbus_set_signal_handler (SIGTERM, signal_handler); #ifdef DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX _dbus_set_signal_handler (SIGIO, signal_handler); diff --git a/tools/dbus-launch.c b/tools/dbus-launch.c index 216f7435..139d0aaf 100644 --- a/tools/dbus-launch.c +++ b/tools/dbus-launch.c @@ -402,7 +402,9 @@ signal_handler (int sig) { switch (sig) { +#ifdef SIGHUP case SIGHUP: +#endif case SIGTERM: got_sighup = TRUE; break; |