0028381: Draw Harness - DRAWEXE hangs up immediatly when redirecting input stream...
authornbv <nbv@opencascade.com>
Mon, 23 Jan 2017 08:05:16 +0000 (11:05 +0300)
committerapn <apn@opencascade.com>
Thu, 26 Jan 2017 10:13:10 +0000 (13:13 +0300)
src/Draw/Draw_Window.cxx

index 1138725..7233f7f 100644 (file)
@@ -2075,15 +2075,11 @@ static DWORD WINAPI readStdinThreadFunc()
       else
       {
         const DWORD anErr = GetLastError();
-        if (anErr == ERROR_INVALID_HANDLE)
+        if (anErr != ERROR_SUCCESS)
         {
           // fallback using fgetws() which would work with pipes
           // but supports Unicode only through multi-byte encoding (which is not UTF-8)
           isConsoleInput = false;
-        }
-        else
-        {
-          std::cerr << "Error #" << anErr << " occurred while reading console input\n";
           continue;
         }
       }