Skip to content

Commit 76c9b58

Browse files
author
Matt Ficken
committed
Fix #74410 by calling WaitForMultipleObjects() instead of
MsgWaitForMultipleObjects()
1 parent 7cdf520 commit 76c9b58

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

win32/select.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ PHPAPI int php_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, stru
6767
if (handles[n_handles] == INVALID_HANDLE_VALUE) {
6868
/* socket */
6969
if (SAFE_FD_ISSET(i, rfds)) {
70-
FD_SET((uint)i, &sock_read);
70+
FD_SET((uint32_t)i, &sock_read);
7171
}
7272
if (SAFE_FD_ISSET(i, wfds)) {
73-
FD_SET((uint)i, &sock_write);
73+
FD_SET((uint32_t)i, &sock_write);
7474
}
7575
if (SAFE_FD_ISSET(i, efds)) {
76-
FD_SET((uint)i, &sock_except);
76+
FD_SET((uint32_t)i, &sock_except);
7777
}
7878
if (i > sock_max_fd) {
7979
sock_max_fd = i;
@@ -117,7 +117,7 @@ PHPAPI int php_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, stru
117117
/* check handles */
118118
DWORD wret;
119119

120-
wret = MsgWaitForMultipleObjects(n_handles, handles, FALSE, retcode > 0 ? 0 : 100, QS_ALLEVENTS);
120+
wret = WaitForMultipleObjects(n_handles, handles, FALSE, retcode > 0 ? 0 : 100);
121121

122122
if (wret == WAIT_TIMEOUT) {
123123
/* set retcode to 0; this is the default.
@@ -136,13 +136,13 @@ PHPAPI int php_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, stru
136136
for (i = 0; i < n_handles; i++) {
137137
if (WAIT_OBJECT_0 == WaitForSingleObject(handles[i], 0)) {
138138
if (SAFE_FD_ISSET(handle_slot_to_fd[i], rfds)) {
139-
FD_SET((uint)handle_slot_to_fd[i], &aread);
139+
FD_SET((uint32_t)handle_slot_to_fd[i], &aread);
140140
}
141141
if (SAFE_FD_ISSET(handle_slot_to_fd[i], wfds)) {
142-
FD_SET((uint)handle_slot_to_fd[i], &awrite);
142+
FD_SET((uint32_t)handle_slot_to_fd[i], &awrite);
143143
}
144144
if (SAFE_FD_ISSET(handle_slot_to_fd[i], efds)) {
145-
FD_SET((uint)handle_slot_to_fd[i], &aexcept);
145+
FD_SET((uint32_t)handle_slot_to_fd[i], &aexcept);
146146
}
147147
retcode++;
148148
}

0 commit comments

Comments
 (0)