Skip to content

Commit

Permalink
sockfilt.c: do not wait on unreliable file or pipe handle
Browse files Browse the repository at this point in the history
The previous implementation caused issues on modern MSYS2 runtimes.
  • Loading branch information
mback2k committed Dec 16, 2015
1 parent 151da51 commit f4646b9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/server/sockfilt.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,8 @@ static DWORD WINAPI select_ws_wait_thread(LPVOID lpParameter)
* Approach: Loop till either the internal event is signalled
* or if the end of the file has already been reached.
*/
while(WaitForMultipleObjectsEx(2, handles, FALSE, INFINITE, FALSE)
== WAIT_OBJECT_0 + 1) {
while(WaitForMultipleObjectsEx(1, handles, FALSE, 0, FALSE)
== WAIT_TIMEOUT) {
/* get total size of file */
length = 0;
size.QuadPart = 0;
Expand Down Expand Up @@ -611,8 +611,8 @@ static DWORD WINAPI select_ws_wait_thread(LPVOID lpParameter)
* Approach: Loop till either the internal event is signalled
* or there is data in the pipe available for reading.
*/
while(WaitForMultipleObjectsEx(2, handles, FALSE, INFINITE, FALSE)
== WAIT_OBJECT_0 + 1) {
while(WaitForMultipleObjectsEx(1, handles, FALSE, 0, FALSE)
== WAIT_TIMEOUT) {
/* peek into the pipe and retrieve the amount of data available */
length = 0;
if(PeekNamedPipe(handle, NULL, 0, NULL, &length, NULL)) {
Expand Down

0 comments on commit f4646b9

Please sign in to comment.