From 7ec55176caa9c9641320d83169d8ca1ee2c42f1a Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Sat, 20 Mar 2021 11:51:18 +0100 Subject: [PATCH] Include signal.h when compiling on various BSDs On ElectroBSD this fixes: cc -DHAVE_CONFIG_H -I. -I../include -I/include/zlib -I/include -I/usr/local/include/openssl -I/usr/local/include -I/include/zlib -I/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -DOPENSSL_NO_KRB5 -g -O2 -c -o init.o init.c init.c:78:47: error: use of undeclared identifier 'SIGINT' if (WIFSIGNALED(ret) && (WTERMSIG(ret) == SIGINT || WTERMSIG(ret) == SIGQUIT)) ^ init.c:78:74: error: use of undeclared identifier 'SIGQUIT' if (WIFSIGNALED(ret) && (WTERMSIG(ret) == SIGINT || WTERMSIG(ret) == SIGQUIT)) ^ The FreeBSD port benchmarks/siege has been using a similar patch (different OS sorting) for several years now. --- src/init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/init.c b/src/init.c index 0408bdc..646aeb8 100644 --- a/src/init.c +++ b/src/init.c @@ -39,6 +39,9 @@ #include #include #include +#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +#include +#endif #define LINESZ 1024