]> granicus.if.org Git - php/commitdiff
Remove HAVE_SIGNAL_H
authorPeter Kokot <peterkokot@gmail.com>
Sun, 7 Apr 2019 13:55:34 +0000 (15:55 +0200)
committerPeter Kokot <peterkokot@gmail.com>
Sun, 7 Apr 2019 13:55:34 +0000 (15:55 +0200)
The `<signal.h>` header file is part of the standard C89 headers [1] and
on current systems can be included unconditionally.

Since file requires at least C89 or greater, the `HAVE_SIGNAL_H` symbol
defined by Autoconf in Zend.m4 [2] can be ommitted and simplifed.

The bundled libmagic (file) also ommits the usage of HAVE_SIGNAL_H since
5.35 however current version in PHP is very modified 5.34 version and
will be refactored separately. Check for HAVE_SIGNAL_H is therefore
still done in the configure.ac.

Refs:
[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4

16 files changed:
TSRM/TSRM.h
Zend/Zend.m4
Zend/zend_alloc.c
Zend/zend_signal.c
Zend/zend_signal.h
ext/standard/exec.c
ext/standard/mail.c
ext/standard/proc_open.c
main/main.c
sapi/cgi/cgi_main.c
sapi/cli/php_cli.c
sapi/cli/php_cli_server.c
sapi/embed/php_embed.c
sapi/fpm/fpm/fpm_main.c
sapi/litespeed/lsapi_main.c
sapi/phpdbg/phpdbg.h

index 5e1f8164ee79f542595b5cc18d1b579004af7820..64661c1ebf1116aaa0a6143f8e7d7b4cc09116a5 100644 (file)
@@ -82,9 +82,7 @@ typedef int ts_rsrc_id;
 # define MUTEX_T st_mutex_t
 #endif
 
-#ifdef HAVE_SIGNAL_H
 #include <signal.h>
-#endif
 
 typedef void (*ts_allocate_ctor)(void *);
 typedef void (*ts_allocate_dtor)(void *);
index c0ada26aeab6e7c0c03fd7ecb9c5b8fea2f4cb92..0755a58f14cb302ab7d3ef63f806a2ce603a3764 100644 (file)
@@ -12,7 +12,6 @@ malloc.h \
 unistd.h \
 sys/types.h \
 sys/time.h \
-signal.h \
 unix.h \
 cpuid.h \
 dlfcn.h)
index 77474c55279154a111136bd69dd470ad8bb84486..3531e79df4b9c54d532df5873f03489115b6b3b1 100644 (file)
 #include "zend_operators.h"
 #include "zend_multiply.h"
 #include "zend_bitset.h"
+#include <signal.h>
 
-#ifdef HAVE_SIGNAL_H
-# include <signal.h>
-#endif
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
index 571d85f848036b592c766db2af559c9696c7f5ec..3e9fd227ac5b3383476551beb2ee9b531eee31af 100644 (file)
 
 #include "zend.h"
 #include "zend_globals.h"
-
-#ifdef HAVE_SIGNAL_H
 #include <signal.h>
-#endif
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
index 1c234b0a0c6f5f8f4a58af09306eb041acefe8c5..0bb191db73245d6af1071d0c73273acebdca8667 100644 (file)
@@ -23,9 +23,7 @@
 
 #ifdef ZEND_SIGNALS
 
-# ifdef HAVE_SIGNAL_H
-#  include <signal.h>
-# endif
+#include <signal.h>
 
 #ifndef NSIG
 #define NSIG 65
index 38399458368190feb438896b3291ddc3139d3514..e21dbacd5f3615879c96ebfea5a7d925755cc1e8 100644 (file)
@@ -31,9 +31,8 @@
 #if HAVE_SYS_WAIT_H
 #include <sys/wait.h>
 #endif
-#if HAVE_SIGNAL_H
+
 #include <signal.h>
-#endif
 
 #if HAVE_SYS_TYPES_H
 #include <sys/types.h>
index 53f75bf32ac5e178cf3015c06a7965511a33e2ef..c1a21c40592b3a13597641fe0f5d192c128951dc 100644 (file)
 #endif
 
 #if PHP_SIGCHILD
-#if HAVE_SIGNAL_H
 #include <signal.h>
 #endif
-#endif
 
 #include "php_syslog.h"
 #include "php_mail.h"
index d8c7615d4ba2a8167019675cd29784d497493e17..326cfc14312f5f3201584dad39a1a6abc98c1f23 100644 (file)
@@ -38,9 +38,7 @@
 #if HAVE_SYS_WAIT_H
 #include <sys/wait.h>
 #endif
-#if HAVE_SIGNAL_H
 #include <signal.h>
-#endif
 
 #if HAVE_SYS_STAT_H
 #include <sys/stat.h>
index de0d0428435f7d336cd96a04516573bf07cc8880..95f6157d454c05d3f94302ee6c567b5d33827f09 100644 (file)
@@ -39,9 +39,9 @@
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-#if HAVE_SIGNAL_H
+
 #include <signal.h>
-#endif
+
 #if HAVE_SETLOCALE
 #include <locale.h>
 #endif
index b22d37f89b2f4e90899f943ca1d907d821153f9a..8a461d8c4471d6108a1463b3e80979e2ff0d45d2 100644 (file)
@@ -45,9 +45,7 @@
 # include <unistd.h>
 #endif
 
-#if HAVE_SIGNAL_H
-# include <signal.h>
-#endif
+#include <signal.h>
 
 #if HAVE_SETLOCALE
 # include <locale.h>
@@ -1779,7 +1777,6 @@ int main(int argc, char *argv[])
        char *decoded_query_string;
        int skip_getopt = 0;
 
-#ifdef HAVE_SIGNAL_H
 #if defined(SIGPIPE) && defined(SIG_IGN)
        signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE in standalone mode so
                                                                that sockets created via fsockopen()
@@ -1788,7 +1785,6 @@ int main(int argc, char *argv[])
                                                                does that for us!  thies@thieso.net
                                                                20000419 */
 #endif
-#endif
 
 #ifdef ZTS
        php_tsrm_startup();
index 4333487a0b2aba1553d74b7eca57fe61fcc042df..364fd1310682043e0ebbe9bcd9d81f616d39b1f0 100644 (file)
@@ -46,9 +46,9 @@
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-#if HAVE_SIGNAL_H
+
 #include <signal.h>
-#endif
+
 #if HAVE_SETLOCALE
 #include <locale.h>
 #endif
 #include "win32/php_registry.h"
 #endif
 
-#if HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-
 #ifdef __riscos__
 #include <unixlib/local.h>
 #endif
@@ -1233,7 +1229,6 @@ int main(int argc, char *argv[])
        }
 #endif
 
-#ifdef HAVE_SIGNAL_H
 #if defined(SIGPIPE) && defined(SIG_IGN)
        signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE in standalone mode so
                                                                that sockets created via fsockopen()
@@ -1242,8 +1237,6 @@ int main(int argc, char *argv[])
                                                                does that for us!  thies@thieso.net
                                                                20000419 */
 #endif
-#endif
-
 
 #ifdef ZTS
        php_tsrm_startup();
index deb61816a7780ae6afef1ea3b16a71b96acfe3ba..c814b73f269dcc78288df3fad4b1a54e4684b02a 100644 (file)
@@ -43,9 +43,7 @@
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-#if HAVE_SIGNAL_H
 #include <signal.h>
-#endif
 #if HAVE_SETLOCALE
 #include <locale.h>
 #endif
@@ -2601,7 +2599,7 @@ int do_cli_server(int argc, char **argv) /* {{{ */
                                PHP_VERSION, buf, server_bind_address, document_root);
        }
 
-#if defined(HAVE_SIGNAL_H) && defined(SIGINT)
+#if defined(SIGINT)
        signal(SIGINT, php_cli_server_sigint_handler);
        zend_signal_init();
 #endif
index 4fcb181cc0c9a66f4921ca5e0312ea755c4dd61e..d651f6b4915d861fa6ebf8e5b735bfe6a7694f0c 100644 (file)
@@ -159,7 +159,6 @@ EMBED_SAPI_API int php_embed_init(int argc, char **argv)
 {
        zend_llist global_vars;
 
-#ifdef HAVE_SIGNAL_H
 #if defined(SIGPIPE) && defined(SIG_IGN)
        signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE in standalone mode so
                                                                 that sockets created via fsockopen()
@@ -168,7 +167,6 @@ EMBED_SAPI_API int php_embed_init(int argc, char **argv)
                                                                 does that for us!  thies@thieso.net
                                                                 20000419 */
 #endif
-#endif
 
 #ifdef ZTS
   php_tsrm_startup();
index 307c02ed7c647cfc24785d493756efb3ffd0eebd..3c637d5990114c11d2e98dab2951f76b775f05b9 100644 (file)
@@ -43,9 +43,7 @@
 # include <unistd.h>
 #endif
 
-#if HAVE_SIGNAL_H
-# include <signal.h>
-#endif
+#include <signal.h>
 
 #if HAVE_SETLOCALE
 # include <locale.h>
@@ -1567,7 +1565,6 @@ int main(int argc, char *argv[])
        zend_bool old_rc_debug;
 #endif
 
-#ifdef HAVE_SIGNAL_H
 #if defined(SIGPIPE) && defined(SIG_IGN)
        signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE in standalone mode so
                                                                that sockets created via fsockopen()
@@ -1576,7 +1573,6 @@ int main(int argc, char *argv[])
                                                                does that for us!  thies@thieso.net
                                                                20000419 */
 #endif
-#endif
 
 #ifdef ZTS
        php_tsrm_startup();
index 2d8eb7532658546af2948450ea94bf8845923814..4a6b1a0f3f91de7272c61dfb3e09b22a79899781 100644 (file)
 
 #endif
 
-#if HAVE_SIGNAL_H
-
 #include <signal.h>
-
-#endif
-
 #include <sys/socket.h>
 #include <arpa/inet.h>
 #include <netinet/in.h>
@@ -1228,11 +1223,9 @@ int main( int argc, char * argv[] )
     int slow_script_msec = 0;
     char time_buf[40];
 
-#ifdef HAVE_SIGNAL_H
 #if defined(SIGPIPE) && defined(SIG_IGN)
     signal(SIGPIPE, SIG_IGN);
 #endif
-#endif
 
 #ifdef ZTS
     php_tsrm_startup();
index c2298037d444df68b8646666c2e67e7245cec24d..d1b22e6f4056ed89f8e3795fdf4aa0351867743e 100644 (file)
@@ -46,7 +46,7 @@
 #include "zend_ini_scanner.h"
 #include "zend_stream.h"
 #include "zend_signal.h"
-#if !defined(_WIN32) && !defined(ZEND_SIGNALS) && defined(HAVE_SIGNAL_H)
+#if !defined(_WIN32) && !defined(ZEND_SIGNALS)
 #      include <signal.h>
 #elif defined(PHP_WIN32)
 #      include "win32/signal.h"