diff --git a/apps/mosquitto_signal/signal_windows.c b/apps/mosquitto_signal/signal_windows.c index e8528933f..94b0eff90 100644 --- a/apps/mosquitto_signal/signal_windows.c +++ b/apps/mosquitto_signal/signal_windows.c @@ -15,13 +15,11 @@ SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause Contributors: Roger Light - initial implementation and documentation. */ -#ifdef WIN32 -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif -# include -# include +#ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN #endif +#include +#include #include #include @@ -32,7 +30,28 @@ SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause #include "mosquitto_signal.h" -void signal_all(const char *eventname) +#undef WITH_TLS +#include "config.h" + +static const char *msig_to_string(enum mosq_sig sig) +{ + switch(sig){ + case MSIG_CONFIG_RELOAD: + return "reload"; + case MSIG_LOG_ROTATE: + return "log_rotate"; + case MSIG_SHUTDOWN: + return "shutdown"; + case MSIG_TREE_PRINT: + return "tree_print"; + case MSIG_XTREPORT: + return "xtreport"; + default: + return ""; + } +} + +void signal_all(enum mosq_signal sig) { DWORD processes[2048], cbneeded, count; int pid; @@ -43,18 +62,17 @@ void signal_all(const char *eventname) } count = cbneeded / sizeof(DWORD); - for(int i=0; i