Revert "Remove a few unused write warning (backport from master, oops)s"

This reverts commit c65d24eaa3.
This commit is contained in:
Nikita Popov 2016-11-20 19:02:40 +01:00
parent c65d24eaa3
commit ff5a65d26b
8 changed files with 10 additions and 9 deletions

View file

@ -1183,6 +1183,7 @@ ZEND_API int zend_eval_string_ex(char *str, zval *retval_ptr, char *string_name,
ZEND_API void zend_timeout(int dummy) /* {{{ */ ZEND_API void zend_timeout(int dummy) /* {{{ */
{ {
if (zend_on_timeout) { if (zend_on_timeout) {
#ifdef ZEND_SIGNALS #ifdef ZEND_SIGNALS
/* /*

View file

@ -125,8 +125,6 @@
# define ZEND_IGNORE_VALUE(x) ((void) (x)) # define ZEND_IGNORE_VALUE(x) ((void) (x))
#endif #endif
#define quiet_write(...) ZEND_IGNORE_VALUE(write(__VA_ARGS__))
/* all HAVE_XXX test have to be after the include of zend_config above */ /* all HAVE_XXX test have to be after the include of zend_config above */
#if defined(HAVE_LIBDL) && !defined(ZEND_WIN32) #if defined(HAVE_LIBDL) && !defined(ZEND_WIN32)

View file

@ -467,7 +467,7 @@ int fpm_log_write(char *log_format) /* {{{ */
if (!test && strlen(buffer) > 0) { if (!test && strlen(buffer) > 0) {
buffer[len] = '\n'; buffer[len] = '\n';
quiet_write(fpm_log_fd, buffer, len + 1); write(fpm_log_fd, buffer, len + 1);
} }
return 0; return 0;

View file

@ -1865,7 +1865,7 @@ consult the installation file that came with this distribution, or visit \n\
if (fpm_globals.send_config_pipe[1]) { if (fpm_globals.send_config_pipe[1]) {
int writeval = 0; int writeval = 0;
zlog(ZLOG_DEBUG, "Sending \"0\" (error) to parent via fd=%d", fpm_globals.send_config_pipe[1]); zlog(ZLOG_DEBUG, "Sending \"0\" (error) to parent via fd=%d", fpm_globals.send_config_pipe[1]);
quiet_write(fpm_globals.send_config_pipe[1], &writeval, sizeof(writeval)); write(fpm_globals.send_config_pipe[1], &writeval, sizeof(writeval));
close(fpm_globals.send_config_pipe[1]); close(fpm_globals.send_config_pipe[1]);
} }
return FPM_EXIT_CONFIG; 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]) { if (fpm_globals.send_config_pipe[1]) {
int writeval = 1; int writeval = 1;
zlog(ZLOG_DEBUG, "Sending \"1\" (OK) to parent via fd=%d", fpm_globals.send_config_pipe[1]); zlog(ZLOG_DEBUG, "Sending \"1\" (OK) to parent via fd=%d", fpm_globals.send_config_pipe[1]);
quiet_write(fpm_globals.send_config_pipe[1], &writeval, sizeof(writeval)); write(fpm_globals.send_config_pipe[1], &writeval, sizeof(writeval));
close(fpm_globals.send_config_pipe[1]); close(fpm_globals.send_config_pipe[1]);
} }
fpm_is_running = 1; fpm_is_running = 1;

View file

@ -174,7 +174,7 @@ static void sig_handler(int signo) /* {{{ */
saved_errno = errno; saved_errno = errno;
s = sig_chars[signo]; s = sig_chars[signo];
quiet_write(sp[1], &s, sizeof(s)); write(sp[1], &s, sizeof(s));
errno = saved_errno; errno = saved_errno;
} }
/* }}} */ /* }}} */

View file

@ -186,11 +186,11 @@ void vzlog(const char *function, int line, int flags, const char *fmt, va_list a
#endif #endif
{ {
buf[len++] = '\n'; buf[len++] = '\n';
quiet_write(zlog_fd > -1 ? zlog_fd : STDERR_FILENO, buf, len); 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) { if (zlog_fd != STDERR_FILENO && zlog_fd != -1 && !launched && (flags & ZLOG_LEVEL_MASK) >= ZLOG_NOTICE) {
quiet_write(STDERR_FILENO, buf, len); write(STDERR_FILENO, buf, len);
} }
} }
/* }}} */ /* }}} */

View file

@ -113,6 +113,8 @@
#define memcpy(...) memcpy_tmp(__VA_ARGS__) #define memcpy(...) memcpy_tmp(__VA_ARGS__)
#endif #endif
#define quiet_write(...) ZEND_IGNORE_VALUE(write(__VA_ARGS__))
#if !defined(PHPDBG_WEBDATA_TRANSFER_H) && !defined(PHPDBG_WEBHELPER_H) #if !defined(PHPDBG_WEBDATA_TRANSFER_H) && !defined(PHPDBG_WEBHELPER_H)
#ifdef ZTS #ifdef ZTS

View file

@ -203,7 +203,7 @@ static int phpdbg_output_pager(int sock, const char *ptr, int len) {
if (memchr(p, '\n', endp - p)) { if (memchr(p, '\n', endp - p)) {
char buf[PHPDBG_MAX_CMD]; char buf[PHPDBG_MAX_CMD];
quiet_write(sock, ZEND_STRL("\r---Type <return> to continue or q <return> to quit---")); write(sock, ZEND_STRL("\r---Type <return> to continue or q <return> to quit---"));
phpdbg_consume_stdin_line(buf); phpdbg_consume_stdin_line(buf);
if (*buf == 'q') { if (*buf == 'q') {
break; break;