From 1b2ee3667543b2588446dba6655720eb929bfe03 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Mon, 3 Apr 2023 08:28:41 +0100 Subject: win32: add fake HUP and QUIT signals It's fairly common for shell scripts to trap this set of signals: EXIT HUP INT QUIT TERM (or the numeric equivalent: 0 1 2 3 15) Add definitions for SIGHUP and SIGQUIT. We don't take any action if traps are defined for them, but at least scripts won't fail. (GitHub issue #303) --- include/mingw.h | 2 ++ networking/httpd.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/mingw.h b/include/mingw.h index a94d90767..8dd905c23 100644 --- a/include/mingw.h +++ b/include/mingw.h @@ -112,6 +112,8 @@ IMPL(getpwent,struct passwd *,NULL,void) /* * signal.h */ +#define SIGHUP 1 +#define SIGQUIT 3 #define SIGKILL 9 #define SIGPIPE 13 diff --git a/networking/httpd.c b/networking/httpd.c index 59b4a769c..b32498ddb 100644 --- a/networking/httpd.c +++ b/networking/httpd.c @@ -2869,7 +2869,7 @@ static void mingw_daemonize(char **argv) } #endif -#ifdef SIGHUP +#if !ENABLE_PLATFORM_MINGW32 static void sighup_handler(int sig UNUSED_PARAM) { int sv = errno; @@ -3034,7 +3034,7 @@ int httpd_main(int argc UNUSED_PARAM, char **argv) #endif parse_conf(DEFAULT_PATH_HTTPD_CONF, FIRST_PARSE); -#ifdef SIGHUP +#if !ENABLE_PLATFORM_MINGW32 if (!(opt & OPT_INETD)) signal(SIGHUP, sighup_handler); #endif -- cgit v1.2.3-55-g6feb