mirror of
https://github.com/php/php-src.git
synced 2024-11-24 02:15:04 +08:00
Remove HAVE_SIGNAL_H
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
This commit is contained in:
parent
fd1ad1e25a
commit
5f8915786f
@ -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 *);
|
||||
|
@ -12,7 +12,6 @@ malloc.h \
|
||||
unistd.h \
|
||||
sys/types.h \
|
||||
sys/time.h \
|
||||
signal.h \
|
||||
unix.h \
|
||||
cpuid.h \
|
||||
dlfcn.h)
|
||||
|
@ -57,10 +57,8 @@
|
||||
#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
|
||||
|
@ -30,10 +30,7 @@
|
||||
|
||||
#include "zend.h"
|
||||
#include "zend_globals.h"
|
||||
|
||||
#ifdef HAVE_SIGNAL_H
|
||||
#include <signal.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
|
@ -23,9 +23,7 @@
|
||||
|
||||
#ifdef ZEND_SIGNALS
|
||||
|
||||
# ifdef HAVE_SIGNAL_H
|
||||
# include <signal.h>
|
||||
# endif
|
||||
#include <signal.h>
|
||||
|
||||
#ifndef NSIG
|
||||
#define NSIG 65
|
||||
|
@ -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>
|
||||
|
@ -35,10 +35,8 @@
|
||||
#endif
|
||||
|
||||
#if PHP_SIGCHILD
|
||||
#if HAVE_SIGNAL_H
|
||||
#include <signal.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "php_syslog.h"
|
||||
#include "php_mail.h"
|
||||
|
@ -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>
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
|
@ -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
|
||||
@ -66,10 +66,6 @@
|
||||
#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();
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -43,12 +43,7 @@
|
||||
|
||||
#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();
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user