From 49446d4b362ec4d0205b60f4cf883cf7e97ecabc Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 27 Sep 2017 13:59:43 +0100 Subject: [PATCH] sysdeps: Stop pretending _dbus_set_signal_handler is portable to Windows None of the things we rely on in POSIX async signal handlers, such as the existence of async-signal-safe write(), are portable to Windows, so the async signal handlers that use this function are #ifdef DBUS_UNIX anyway. Remove the unused stub function from the Windows side, and move the declaration to the Unix-specific header. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103010 Signed-off-by: Simon McVittie Reviewed-by: Philip Withnall --- dbus/dbus-sysdeps-unix.h | 6 ++++++ dbus/dbus-sysdeps-util-win.c | 12 ------------ dbus/dbus-sysdeps.h | 6 ------ 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/dbus/dbus-sysdeps-unix.h b/dbus/dbus-sysdeps-unix.h index 279cae276..8d3df2d67 100644 --- a/dbus/dbus-sysdeps-unix.h +++ b/dbus/dbus-sysdeps-unix.h @@ -165,6 +165,12 @@ DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_ensure_standard_fds (DBusEnsureStandardFdsFlags flags, const char **error_str_p); +/** A UNIX signal handler */ +typedef void (* DBusSignalHandler) (int sig); + +void _dbus_set_signal_handler (int sig, + DBusSignalHandler handler); + /** @} */ DBUS_END_DECLS diff --git a/dbus/dbus-sysdeps-util-win.c b/dbus/dbus-sysdeps-util-win.c index 05bd976d7..1ef4ae6cd 100644 --- a/dbus/dbus-sysdeps-util-win.c +++ b/dbus/dbus-sysdeps-util-win.c @@ -296,18 +296,6 @@ _dbus_rlimit_free (DBusRLimit *lim) _dbus_assert (lim == NULL); } -/** Installs a signal handler - * - * @param sig the signal to handle - * @param handler the handler - */ -void -_dbus_set_signal_handler (int sig, - DBusSignalHandler handler) -{ - _dbus_verbose ("has to be implemented\n"); -} - /** * stat() wrapper. * diff --git a/dbus/dbus-sysdeps.h b/dbus/dbus-sysdeps.h index e204fca57..6892247f1 100644 --- a/dbus/dbus-sysdeps.h +++ b/dbus/dbus-sysdeps.h @@ -541,12 +541,6 @@ dbus_bool_t _dbus_command_for_pid (unsigned long pid, int max_len, DBusError *error); -/** A UNIX signal handler */ -typedef void (* DBusSignalHandler) (int sig); - -void _dbus_set_signal_handler (int sig, - DBusSignalHandler handler); - dbus_bool_t _dbus_user_at_console (const char *username, DBusError *error); -- 2.47.3