Skip to content

Commit c65d24e

Browse files
committed
Remove a few unused write warning (backport from master, oops)s
1 parent ebfd93f commit c65d24e

File tree

9 files changed

+10
-10
lines changed

9 files changed

+10
-10
lines changed

Zend/zend_execute_API.c

-1
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,6 @@ ZEND_API int zend_eval_string_ex(char *str, zval *retval_ptr, char *string_name,
11831183

11841184
ZEND_API void zend_timeout(int dummy) /* {{{ */
11851185
{
1186-
11871186
if (zend_on_timeout) {
11881187
#ifdef ZEND_SIGNALS
11891188
/*

Zend/zend_portability.h

+2
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@
125125
# define ZEND_IGNORE_VALUE(x) ((void) (x))
126126
#endif
127127

128+
#define quiet_write(...) ZEND_IGNORE_VALUE(write(__VA_ARGS__))
129+
128130
/* all HAVE_XXX test have to be after the include of zend_config above */
129131

130132
#if defined(HAVE_LIBDL) && !defined(ZEND_WIN32)

sapi/fpm/fpm/fpm_log.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ int fpm_log_write(char *log_format) /* {{{ */
467467

468468
if (!test && strlen(buffer) > 0) {
469469
buffer[len] = '\n';
470-
write(fpm_log_fd, buffer, len + 1);
470+
quiet_write(fpm_log_fd, buffer, len + 1);
471471
}
472472

473473
return 0;

sapi/fpm/fpm/fpm_main.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1865,7 +1865,7 @@ consult the installation file that came with this distribution, or visit \n\
18651865
if (fpm_globals.send_config_pipe[1]) {
18661866
int writeval = 0;
18671867
zlog(ZLOG_DEBUG, "Sending \"0\" (error) to parent via fd=%d", fpm_globals.send_config_pipe[1]);
1868-
write(fpm_globals.send_config_pipe[1], &writeval, sizeof(writeval));
1868+
quiet_write(fpm_globals.send_config_pipe[1], &writeval, sizeof(writeval));
18691869
close(fpm_globals.send_config_pipe[1]);
18701870
}
18711871
return FPM_EXIT_CONFIG;
@@ -1874,7 +1874,7 @@ consult the installation file that came with this distribution, or visit \n\
18741874
if (fpm_globals.send_config_pipe[1]) {
18751875
int writeval = 1;
18761876
zlog(ZLOG_DEBUG, "Sending \"1\" (OK) to parent via fd=%d", fpm_globals.send_config_pipe[1]);
1877-
write(fpm_globals.send_config_pipe[1], &writeval, sizeof(writeval));
1877+
quiet_write(fpm_globals.send_config_pipe[1], &writeval, sizeof(writeval));
18781878
close(fpm_globals.send_config_pipe[1]);
18791879
}
18801880
fpm_is_running = 1;

sapi/fpm/fpm/fpm_signals.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ static void sig_handler(int signo) /* {{{ */
174174

175175
saved_errno = errno;
176176
s = sig_chars[signo];
177-
write(sp[1], &s, sizeof(s));
177+
quiet_write(sp[1], &s, sizeof(s));
178178
errno = saved_errno;
179179
}
180180
/* }}} */

sapi/fpm/fpm/zlog.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,11 @@ void vzlog(const char *function, int line, int flags, const char *fmt, va_list a
186186
#endif
187187
{
188188
buf[len++] = '\n';
189-
write(zlog_fd > -1 ? zlog_fd : STDERR_FILENO, buf, len);
189+
quiet_write(zlog_fd > -1 ? zlog_fd : STDERR_FILENO, buf, len);
190190
}
191191

192192
if (zlog_fd != STDERR_FILENO && zlog_fd != -1 && !launched && (flags & ZLOG_LEVEL_MASK) >= ZLOG_NOTICE) {
193-
write(STDERR_FILENO, buf, len);
193+
quiet_write(STDERR_FILENO, buf, len);
194194
}
195195
}
196196
/* }}} */

sapi/phpdbg/phpdbg.c

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "zend_alloc.h"
3434
#include "phpdbg_eol.h"
3535
#include "phpdbg_print.h"
36+
#include "phpdbg_help.h"
3637

3738
#include "ext/standard/basic_functions.h"
3839

sapi/phpdbg/phpdbg.h

-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,6 @@
113113
#define memcpy(...) memcpy_tmp(__VA_ARGS__)
114114
#endif
115115

116-
#define quiet_write(...) ZEND_IGNORE_VALUE(write(__VA_ARGS__))
117-
118116
#if !defined(PHPDBG_WEBDATA_TRANSFER_H) && !defined(PHPDBG_WEBHELPER_H)
119117

120118
#ifdef ZTS

sapi/phpdbg/phpdbg_io.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ static int phpdbg_output_pager(int sock, const char *ptr, int len) {
203203

204204
if (memchr(p, '\n', endp - p)) {
205205
char buf[PHPDBG_MAX_CMD];
206-
write(sock, ZEND_STRL("\r---Type <return> to continue or q <return> to quit---"));
206+
quiet_write(sock, ZEND_STRL("\r---Type <return> to continue or q <return> to quit---"));
207207
phpdbg_consume_stdin_line(buf);
208208
if (*buf == 'q') {
209209
break;

0 commit comments

Comments
 (0)