]> granicus.if.org Git - php/commitdiff
Suppress SIG_ERR cast warnings
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 15 Apr 2020 08:37:33 +0000 (10:37 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Wed, 15 Apr 2020 09:01:12 +0000 (11:01 +0200)
By casting to void*. I don't want to deal with this right now.

ext/pcntl/pcntl.c
ext/pcntl/php_signal.c

index c7aa6bcbc3b34bb90358ae4cb3c046be2a6d6ba9..a4554a61cdca2ab11748f9881bf979de592a3bd4 100644 (file)
@@ -979,7 +979,7 @@ PHP_FUNCTION(pcntl_signal)
                        php_error_docref(NULL, E_WARNING, "Invalid value for handle argument specified");
                        RETURN_FALSE;
                }
-               if (php_signal(signo, (Sigfunc *) Z_LVAL_P(handle), (int) restart_syscalls) == (Sigfunc *)SIG_ERR) {
+               if (php_signal(signo, (Sigfunc *) Z_LVAL_P(handle), (int) restart_syscalls) == (void *)SIG_ERR) {
                        PCNTL_G(last_error) = errno;
                        php_error_docref(NULL, E_WARNING, "Error assigning signal");
                        RETURN_FALSE;
@@ -1002,7 +1002,7 @@ PHP_FUNCTION(pcntl_signal)
        handle = zend_hash_index_update(&PCNTL_G(php_signal_table), signo, handle);
        Z_TRY_ADDREF_P(handle);
 
-       if (php_signal4(signo, pcntl_signal_handler, (int) restart_syscalls, 1) == (Sigfunc *)SIG_ERR) {
+       if (php_signal4(signo, pcntl_signal_handler, (int) restart_syscalls, 1) == (void *)SIG_ERR) {
                PCNTL_G(last_error) = errno;
                php_error_docref(NULL, E_WARNING, "Error assigning signal");
                RETURN_FALSE;
index 44d92dabd009f7c7e122ea670e1925588a12a1f9..95b4a16d6df9e76a8fa5f07b534d40983f4a23ee 100644 (file)
@@ -49,7 +49,7 @@ Sigfunc *php_signal4(int signo, Sigfunc *func, int restart, int mask_all)
 #endif
        }
        if (zend_sigaction(signo, &act, &oact) < 0) {
-               return (Sigfunc*)SIG_ERR;
+               return (void*)SIG_ERR;
        }
 
 #ifdef HAVE_STRUCT_SIGINFO_T