From: Marc Hoersken Date: Tue, 22 Apr 2014 12:52:33 +0000 (+0200) Subject: sockfilt.c: fixed getting stuck waiting for MinGW stdin pipe X-Git-Tag: upstream/7.37.1~297 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6a03f6368fb3cb64fc29fcdcef543ac8990e33c0;p=platform%2Fupstream%2Fcurl.git sockfilt.c: fixed getting stuck waiting for MinGW stdin pipe --- diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c index b7178ad..0ceaae2 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;