Skip to content

Commit 868e99d

Browse files
committed
cli: Convert to php_pollfd_for_ms from select
This is not a poll call, but it is functionally the same as one; convert it to the single fd polling function which is clearer to read.
1 parent 0c67aa2 commit 868e99d

1 file changed

Lines changed: 1 addition & 15 deletions

File tree

sapi/cli/php_cli.c

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,6 @@
7878
#include "php_cli_process_title.h"
7979
#include "php_cli_process_title_arginfo.h"
8080

81-
#ifndef PHP_WIN32
82-
# define php_select(m, r, w, e, t) select(m, r, w, e, t)
83-
#else
84-
# include "win32/select.h"
85-
#endif
86-
8781
#if defined(PHP_WIN32) && defined(HAVE_OPENSSL_EXT)
8882
# include "openssl/applink.c"
8983
#endif
@@ -218,20 +212,12 @@ static void print_extensions(void) /* {{{ */
218212
#ifdef PHP_WRITE_STDOUT
219213
static inline bool sapi_cli_select(php_socket_t fd)
220214
{
221-
fd_set wfd;
222215
struct timeval tv;
223-
int ret;
224-
225-
FD_ZERO(&wfd);
226-
227-
PHP_SAFE_FD_SET(fd, &wfd);
228216

229217
tv.tv_sec = (long)FG(default_socket_timeout);
230218
tv.tv_usec = 0;
231219

232-
ret = php_select(fd+1, NULL, &wfd, NULL, &tv);
233-
234-
return ret != -1;
220+
return php_pollfd_for(fd, POLLOUT, &tv) != -1;
235221
}
236222
#endif
237223

0 commit comments

Comments
 (0)