[tor-commits] [tor/master] If hProcess is NULL, read_all_handle returns if it would block
nickm at torproject.org
nickm at torproject.org
Tue Aug 30 19:58:37 UTC 2011
commit c5796a8fb2fc70085c771d6296d4f29a7ddb68ae
Author: Steven Murdoch <Steven.Murdoch at cl.cam.ac.uk>
Date: Sat Jul 23 21:35:50 2011 +0100
If hProcess is NULL, read_all_handle returns if it would block
---
src/common/util.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/common/util.c b/src/common/util.c
index 31d5586..2691b1f 100644
--- a/src/common/util.c
+++ b/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)
More information about the tor-commits
mailing list