aboutsummaryrefslogtreecommitdiff
path: root/src/lib/process
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@torproject.org>2018-12-20 13:02:22 +0100
committerAlexander Færøy <ahf@torproject.org>2018-12-20 13:02:22 +0100
commit36e24782f87c25d13b4c918c66cd4affaab8df79 (patch)
treec5e945f844d814a9d773c2ba6ea6337e69776a24 /src/lib/process
parentc6e041e3d8dcc6f887014f9dd8887faebf5f4a49 (diff)
downloadtor-36e24782f87c25d13b4c918c66cd4affaab8df79.tar.gz
tor-36e24782f87c25d13b4c918c66cd4affaab8df79.zip
Remember to set `reached_eof` when our handles are reporting errors.
This patch adds some missing calls to set `reached_eof` of our handles when various error conditions happens or when we close our handle (which happens at `process_terminate()`. See: https://bugs.torproject.org/28179
Diffstat (limited to 'src/lib/process')
-rw-r--r--src/lib/process/process_win32.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/process/process_win32.c b/src/lib/process/process_win32.c
index 71dd4001c8..358765f790 100644
--- a/src/lib/process/process_win32.c
+++ b/src/lib/process/process_win32.c
@@ -367,6 +367,7 @@ process_win32_write(struct process_t *process, buf_t *buffer)
if (! ret) {
log_warn(LD_PROCESS, "WriteFileEx() failed: %s",
format_win32_error(GetLastError()));
+ win32_process->stdin_handle.reached_eof = true;
return 0;
}
@@ -749,6 +750,7 @@ process_win32_cleanup_handle(process_win32_handle_t *handle)
if (handle->pipe != INVALID_HANDLE_VALUE) {
CloseHandle(handle->pipe);
handle->pipe = INVALID_HANDLE_VALUE;
+ handle->reached_eof = true;
}
}
@@ -930,6 +932,7 @@ process_win32_read_from_handle(process_win32_handle_t *handle,
if (! ret) {
log_warn(LD_PROCESS, "ReadFileEx() failed: %s",
format_win32_error(GetLastError()));
+ handle->reached_eof = true;
return bytes_available;
}