Commit 6a03f636 authored by Marc Hoersken's avatar Marc Hoersken
Browse files

sockfilt.c: fixed getting stuck waiting for MinGW stdin pipe

parent a5d7ec18
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -568,15 +568,19 @@ 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(GetLastError() == ERROR_BROKEN_PIPE)
        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;
        }
      }
      break;

    default: