mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-13 06:33:44 +01:00
No need to log ordinary EOF conditions as LOG_WARN.
Let's not use log_warn() when a pipe is closed under what should be considered normal conditions. See: https://bugs.torproject.org/28179
This commit is contained in:
parent
412fbe9f17
commit
7762088967
@ -365,8 +365,17 @@ process_win32_write(struct process_t *process, buf_t *buffer)
|
|||||||
process_win32_stdin_write_done);
|
process_win32_stdin_write_done);
|
||||||
|
|
||||||
if (! ret) {
|
if (! ret) {
|
||||||
|
error_code = GetLastError();
|
||||||
|
|
||||||
|
/* No need to log at warning level for these two. */
|
||||||
|
if (error_code == ERROR_HANDLE_EOF || error_code == ERROR_BROKEN_PIPE) {
|
||||||
|
log_debug(LD_PROCESS, "WriteFileEx() returned EOF from pipe: %s",
|
||||||
|
format_win32_error(error_code));
|
||||||
|
} else {
|
||||||
log_warn(LD_PROCESS, "WriteFileEx() failed: %s",
|
log_warn(LD_PROCESS, "WriteFileEx() failed: %s",
|
||||||
format_win32_error(GetLastError()));
|
format_win32_error(error_code));
|
||||||
|
}
|
||||||
|
|
||||||
win32_process->stdin_handle.reached_eof = true;
|
win32_process->stdin_handle.reached_eof = true;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -897,8 +906,17 @@ process_win32_read_from_handle(process_win32_handle_t *handle,
|
|||||||
callback);
|
callback);
|
||||||
|
|
||||||
if (! ret) {
|
if (! ret) {
|
||||||
|
error_code = GetLastError();
|
||||||
|
|
||||||
|
/* No need to log at warning level for these two. */
|
||||||
|
if (error_code == ERROR_HANDLE_EOF || error_code == ERROR_BROKEN_PIPE) {
|
||||||
|
log_debug(LD_PROCESS, "ReadFileEx() returned EOF from pipe: %s",
|
||||||
|
format_win32_error(error_code));
|
||||||
|
} else {
|
||||||
log_warn(LD_PROCESS, "ReadFileEx() failed: %s",
|
log_warn(LD_PROCESS, "ReadFileEx() failed: %s",
|
||||||
format_win32_error(GetLastError()));
|
format_win32_error(error_code));
|
||||||
|
}
|
||||||
|
|
||||||
handle->reached_eof = true;
|
handle->reached_eof = true;
|
||||||
return bytes_available;
|
return bytes_available;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user