]> granicus.if.org Git - php/commitdiff
Remove a few unused write warning (backport from master, oops)s
authorBob Weinand <bobwei9@hotmail.com>
Sun, 20 Nov 2016 13:14:46 +0000 (14:14 +0100)
committerBob Weinand <bobwei9@hotmail.com>
Sun, 20 Nov 2016 13:17:14 +0000 (14:17 +0100)
Zend/zend_execute_API.c
Zend/zend_portability.h
sapi/fpm/fpm/fpm_log.c
sapi/fpm/fpm/fpm_main.c
sapi/fpm/fpm/fpm_signals.c
sapi/fpm/fpm/zlog.c
sapi/phpdbg/phpdbg.c
sapi/phpdbg/phpdbg.h
sapi/phpdbg/phpdbg_io.c

index f96cac5f097603a45e1f4fdac03e40c07fa7d104..3f8025b648c6395c4c572320049c4a2f4e7bec0c 100644 (file)
@@ -1183,7 +1183,6 @@ ZEND_API int zend_eval_string_ex(char *str, zval *retval_ptr, char *string_name,
 
 ZEND_API void zend_timeout(int dummy) /* {{{ */
 {
-
        if (zend_on_timeout) {
 #ifdef ZEND_SIGNALS
                /*
index f1871294166c47117e76da8b8ad06df4202fdbde..d299004ce42c99b67b005b3fec0a822fb628c022 100644 (file)
 # define ZEND_IGNORE_VALUE(x) ((void) (x))
 #endif
 
+#define quiet_write(...) ZEND_IGNORE_VALUE(write(__VA_ARGS__))
+
 /* all HAVE_XXX test have to be after the include of zend_config above */
 
 #if defined(HAVE_LIBDL) && !defined(ZEND_WIN32)
index 5aad9a08c9e1738fe118226438f7c28eff031b0e..b74f47a340aeb790a4df18a8edfc16ba13f50ddc 100644 (file)
@@ -467,7 +467,7 @@ int fpm_log_write(char *log_format) /* {{{ */
 
        if (!test && strlen(buffer) > 0) {
                buffer[len] = '\n';
-               write(fpm_log_fd, buffer, len + 1);
+               quiet_write(fpm_log_fd, buffer, len + 1);
        }
 
        return 0;
index 5adeb63b7a18028a4e43654e429dbd3556dca237..76b9298411deb6fc30c8c1c91bdeab4a17534ca6 100644 (file)
@@ -1865,7 +1865,7 @@ consult the installation file that came with this distribution, or visit \n\
                if (fpm_globals.send_config_pipe[1]) {
                        int writeval = 0;
                        zlog(ZLOG_DEBUG, "Sending \"0\" (error) to parent via fd=%d", fpm_globals.send_config_pipe[1]);
-                       write(fpm_globals.send_config_pipe[1], &writeval, sizeof(writeval));
+                       quiet_write(fpm_globals.send_config_pipe[1], &writeval, sizeof(writeval));
                        close(fpm_globals.send_config_pipe[1]);
                }
                return FPM_EXIT_CONFIG;
@@ -1874,7 +1874,7 @@ consult the installation file that came with this distribution, or visit \n\
        if (fpm_globals.send_config_pipe[1]) {
                int writeval = 1;
                zlog(ZLOG_DEBUG, "Sending \"1\" (OK) to parent via fd=%d", fpm_globals.send_config_pipe[1]);
-               write(fpm_globals.send_config_pipe[1], &writeval, sizeof(writeval));
+               quiet_write(fpm_globals.send_config_pipe[1], &writeval, sizeof(writeval));
                close(fpm_globals.send_config_pipe[1]);
        }
        fpm_is_running = 1;
index a637e69e71949ff361765b0bead06682396dbb11..f80de5d09f4591e379c517f9c205120691c8d8b3 100644 (file)
@@ -174,7 +174,7 @@ static void sig_handler(int signo) /* {{{ */
 
        saved_errno = errno;
        s = sig_chars[signo];
-       write(sp[1], &s, sizeof(s));
+       quiet_write(sp[1], &s, sizeof(s));
        errno = saved_errno;
 }
 /* }}} */
index 1659c77efcaea2952af97708bf6d09522db13c55..1266be85e655a9ff943793c4b10735b4d4e80d97 100644 (file)
@@ -186,11 +186,11 @@ void vzlog(const char *function, int line, int flags, const char *fmt, va_list a
 #endif
        {
                buf[len++] = '\n';
-               write(zlog_fd > -1 ? zlog_fd : STDERR_FILENO, buf, len);
+               quiet_write(zlog_fd > -1 ? zlog_fd : STDERR_FILENO, buf, len);
        }
 
        if (zlog_fd != STDERR_FILENO && zlog_fd != -1 && !launched && (flags & ZLOG_LEVEL_MASK) >= ZLOG_NOTICE) {
-               write(STDERR_FILENO, buf, len);
+               quiet_write(STDERR_FILENO, buf, len);
        }
 }
 /* }}} */
index 2c43a9c8538b9c4cc1eb17ed2629c962d83bc611..a62b40907273c4bd1d95f2f69765253dc0f24912 100644 (file)
@@ -33,6 +33,7 @@
 #include "zend_alloc.h"
 #include "phpdbg_eol.h"
 #include "phpdbg_print.h"
+#include "phpdbg_help.h"
 
 #include "ext/standard/basic_functions.h"
 
index 94c5471e22d8e4b35a5d310c51f7ef4a459de10f..3df2be0aed51ef05554810b36f1328328bb18c8d 100644 (file)
 #define memcpy(...) memcpy_tmp(__VA_ARGS__)
 #endif
 
-#define quiet_write(...) ZEND_IGNORE_VALUE(write(__VA_ARGS__))
-
 #if !defined(PHPDBG_WEBDATA_TRANSFER_H) && !defined(PHPDBG_WEBHELPER_H)
 
 #ifdef ZTS
index b2f4ba7c0d8ad5a51ee7ccec747323b53854246f..69417e3d0b69eba7eb6f7425ee164b6df5edc06e 100644 (file)
@@ -203,7 +203,7 @@ static int phpdbg_output_pager(int sock, const char *ptr, int len) {
                        
                        if (memchr(p, '\n', endp - p)) {
                                char buf[PHPDBG_MAX_CMD];
-                               write(sock, ZEND_STRL("\r---Type <return> to continue or q <return> to quit---"));
+                               quiet_write(sock, ZEND_STRL("\r---Type <return> to continue or q <return> to quit---"));
                                phpdbg_consume_stdin_line(buf);
                                if (*buf == 'q') {
                                        break;