소스 검색

If hProcess is NULL, read_all_handle returns if it would block

Steven Murdoch 12 년 전
부모
커밋
c5796a8fb2
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      src/common/util.c

+ 3 - 3
src/common/util.c

@@ -3304,12 +3304,12 @@ read_all_handle(HANDLE h, char *buf, size_t count, HANDLE hProcess)
         "Failed to peek from handle: %s",
         format_win32_error(GetLastError()));
       return -1;
-    } else if (0 == byte_count) {
+    } else if (0 == byte_count) 
       /* Nothing available: process exited or it is busy */
 
-      /* Keep on reading if we don't know whether the process is running */
+      /* Exit if we don't know whether the process is running */
       if (NULL == hProcess)
-        continue;
+        break;
 
       /* The process exited and there's nothing left to read from it */
       if (process_exited)