diff options
author | Marc Hoersken <info@marc-hoersken.de> | 2014-04-22 14:52:33 +0200 |
---|---|---|
committer | Marc Hoersken <info@marc-hoersken.de> | 2014-04-22 17:22:41 +0200 |
commit | 6a03f6368fb3cb64fc29fcdcef543ac8990e33c0 (patch) | |
tree | 5a5171fb7fe7fa7df04459a49028c6060745aa9b | |
parent | a5d7ec184826fb39f61e90f48b29b5783bca66a8 (diff) |
sockfilt.c: fixed getting stuck waiting for MinGW stdin pipe
-rw-r--r-- | tests/server/sockfilt.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c index b7178add9..0ceaae216 100644 --- a/tests/server/sockfilt.c +++ b/tests/server/sockfilt.c @@ -568,14 +568,18 @@ static DWORD WINAPI select_ws_stdin_wait_thread(LPVOID lpParameter) case FILE_TYPE_PIPE: while(WaitForMultipleObjectsEx(2, handles, FALSE, INFINITE, FALSE) == WAIT_OBJECT_0 + 1) { - if(!PeekNamedPipe(handle, NULL, 0, NULL, &length, NULL)) { + if(PeekNamedPipe(handle, NULL, 0, NULL, &length, NULL)) { + if(length == 0) + SleepEx(100, FALSE); + else + break; + } + else { if(GetLastError() == ERROR_BROKEN_PIPE) SleepEx(100, FALSE); else break; } - else - break; } break; |