RE: [PHP-CVS] com php-src: Remove a few unused write warning (backport from master, oops)s: 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
| From: | Anatol Belski | Date: | Sun, 20 Nov 2016 18:11:11 +0000 |
| Subject: | RE: [PHP-CVS] com php-src: Remove a few unused write warning (backport from master, oops)s: 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 |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-95905@lists.php.net to get a copy of this message | ||
Hi Bob,
> -----Original Message-----
> From: Bob Weinand [mailto:bwoebi@php.net]
> Sent: Sunday, November 20, 2016 2:17 PM
> To: php-cvs@lists.php.net
> Subject: [PHP-CVS] com php-src: Remove a few unused write warning (backport
> from master, oops)s: 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
>
> Commit: c65d24eaa3671e61db7c2a3f28daeaf7c74ac758
> Author: Bob Weinand <bobwei9@hotmail.com> Sun, 20 Nov 2016
> 14:14:46 +0100
> Parents: ebfd93f725eb9b9cfadbbde98047efe76f658da6
> Branches: PHP-7.0
>
This breaks FPM currently, please check Travis. Probably, it'd also make sense to prefix with
zend_, to avoid naming conflicts.
Regards
Anatol
> Link: http://git.php.net/?p=php-
> src.git;a=commitdiff;h=c65d24eaa3671e61db7c2a3f28daeaf7c74ac758
>
> Log:
> Remove a few unused write warning (backport from master, oops)s
>
> Changed paths:
> M Zend/zend_execute_API.c
> M Zend/zend_portability.h
> M sapi/fpm/fpm/fpm_log.c
> M sapi/fpm/fpm/fpm_main.c
> M sapi/fpm/fpm/fpm_signals.c
> M sapi/fpm/fpm/zlog.c
> M sapi/phpdbg/phpdbg.c
> M sapi/phpdbg/phpdbg.h
> M sapi/phpdbg/phpdbg_io.c
>
>
> Diff:
> diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index
> f96cac5..3f8025b 100644
> --- a/Zend/zend_execute_API.c
> +++ b/Zend/zend_execute_API.c
> @@ -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
> /*
> diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h index
> f187129..d299004 100644
> --- a/Zend/zend_portability.h
> +++ b/Zend/zend_portability.h
> @@ -125,6 +125,8 @@
> # 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) diff --git
> a/sapi/fpm/fpm/fpm_log.c b/sapi/fpm/fpm/fpm_log.c index 5aad9a0..b74f47a
> 100644
> --- a/sapi/fpm/fpm/fpm_log.c
> +++ b/sapi/fpm/fpm/fpm_log.c
> @@ -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;
> diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c index
> 5adeb63..76b9298 100644
> --- a/sapi/fpm/fpm/fpm_main.c
> +++ b/sapi/fpm/fpm/fpm_main.c
> @@ -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;
> diff --git a/sapi/fpm/fpm/fpm_signals.c b/sapi/fpm/fpm/fpm_signals.c index
> a637e69..f80de5d 100644
> --- a/sapi/fpm/fpm/fpm_signals.c
> +++ b/sapi/fpm/fpm/fpm_signals.c
> @@ -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;
> }
> /* }}} */
> diff --git a/sapi/fpm/fpm/zlog.c b/sapi/fpm/fpm/zlog.c index 1659c77..1266be8
> 100644
> --- a/sapi/fpm/fpm/zlog.c
> +++ b/sapi/fpm/fpm/zlog.c
> @@ -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);
> }
> }
> /* }}} */
> diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index
> 2c43a9c..a62b409 100644
> --- a/sapi/phpdbg/phpdbg.c
> +++ b/sapi/phpdbg/phpdbg.c
> @@ -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"
>
> diff --git a/sapi/phpdbg/phpdbg.h b/sapi/phpdbg/phpdbg.h index
> 94c5471..3df2be0 100644
> --- a/sapi/phpdbg/phpdbg.h
> +++ b/sapi/phpdbg/phpdbg.h
> @@ -113,8 +113,6 @@
> #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
> diff --git a/sapi/phpdbg/phpdbg_io.c b/sapi/phpdbg/phpdbg_io.c index
> b2f4ba7..69417e3 100644
> --- a/sapi/phpdbg/phpdbg_io.c
> +++ b/sapi/phpdbg/phpdbg_io.c
> @@ -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;
>
>
> --
> PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit:
> http://www.php.net/unsub.php