]> granicus.if.org Git - php/commitdiff
Remove a few unused write warnings
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:15:02 +0000 (14:15 +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 4a4f2f83f3f290e9a2d4ec4c9b6c735c0b71fae6..75b4d559ea0734c6c0d3e4694eab38f8f3678e97 100644 (file)
@@ -1207,7 +1207,7 @@ static void zend_timeout_handler(int dummy) /* {{{ */
 
                output_len = snprintf(log_buffer, sizeof(log_buffer), "\nFatal error: Maximum execution time of " ZEND_LONG_FMT "+" ZEND_LONG_FMT " seconds exceeded (terminated) in %s on line %d\n", EG(timeout_seconds), EG(hard_timeout), error_filename, error_lineno);
                if (output_len > 0) {
-                       write(2, log_buffer, MIN(output_len, sizeof(log_buffer)));
+                       quiet_write(2, log_buffer, MIN(output_len, sizeof(log_buffer)));
                }
                _exit(1);
     }
index d2126d2755a4d2599722e28ff3c723a9decfe5c7..7e80d8545c545f87d69bb58647ebce4b85527544 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 e04c23699134147a504b9ec5989dd4ca2d084dd6..c7e1d1de50275390e6213bf161c73fc69d0d1400 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 15f4da70fb8c3981cd2220755b918960669f1ba5..569b8bc2e6c356803882ee0950ebaa72ca49770c 100644 (file)
@@ -1864,7 +1864,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;
@@ -1873,7 +1873,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 8d0a4caf255dc460b9427e4eba0637b382ac171c..c1a8f378bcdf8b6932dc5863c1bdafaf7445087e 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 a1aeef70d2bc053fed6aa9d3aa9883ab4f0f2412..33a806d57d920f22449d199baad20ce3714e4a3e 100644 (file)
@@ -29,6 +29,7 @@
 #include "zend_alloc.h"
 #include "phpdbg_eol.h"
 #include "phpdbg_print.h"
+#include "phpdbg_help.h"
 
 #include "ext/standard/basic_functions.h"
 
index 84041b125cacec4d370181abb7531657011aeea8..cf591a8a4e938e6b495e9ddf89bdb07f14f9e847 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;