aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2023-04-03 08:28:41 +0100
committerRon Yorston <rmy@pobox.com>2023-04-03 08:31:56 +0100
commit1b2ee3667543b2588446dba6655720eb929bfe03 (patch)
tree6a6b13a678661fa8d193b89ca360024cfc0879b9
parentef02a404777a782757a65234e037a24c64ac7c96 (diff)
downloadbusybox-w32-1b2ee3667543b2588446dba6655720eb929bfe03.tar.gz
busybox-w32-1b2ee3667543b2588446dba6655720eb929bfe03.tar.bz2
busybox-w32-1b2ee3667543b2588446dba6655720eb929bfe03.zip
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)
-rw-r--r--include/mingw.h2
-rw-r--r--networking/httpd.c4
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)
112/* 112/*
113 * signal.h 113 * signal.h
114 */ 114 */
115#define SIGHUP 1
116#define SIGQUIT 3
115#define SIGKILL 9 117#define SIGKILL 9
116#define SIGPIPE 13 118#define SIGPIPE 13
117 119
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)
2869} 2869}
2870#endif 2870#endif
2871 2871
2872#ifdef SIGHUP 2872#if !ENABLE_PLATFORM_MINGW32
2873static void sighup_handler(int sig UNUSED_PARAM) 2873static void sighup_handler(int sig UNUSED_PARAM)
2874{ 2874{
2875 int sv = errno; 2875 int sv = errno;
@@ -3034,7 +3034,7 @@ int httpd_main(int argc UNUSED_PARAM, char **argv)
3034#endif 3034#endif
3035 3035
3036 parse_conf(DEFAULT_PATH_HTTPD_CONF, FIRST_PARSE); 3036 parse_conf(DEFAULT_PATH_HTTPD_CONF, FIRST_PARSE);
3037#ifdef SIGHUP 3037#if !ENABLE_PLATFORM_MINGW32
3038 if (!(opt & OPT_INETD)) 3038 if (!(opt & OPT_INETD))
3039 signal(SIGHUP, sighup_handler); 3039 signal(SIGHUP, sighup_handler);
3040#endif 3040#endif