diff options
| author | Alex Trotsenko <alex1973tr@gmail.com> | 2021-08-31 19:44:53 +0300 |
|---|---|---|
| committer | Alex Trotsenko <alex1973tr@gmail.com> | 2021-09-03 09:31:42 +0300 |
| commit | 340131b4be282063d5dbe352a58e4b2c45994f77 (patch) | |
| tree | 16517dfb441b1c8ad62cb8ec17e547bc439b0e13 /src/corelib/io/qwindowspipewriter.cpp | |
| parent | 5c779f207fb05bbb5263ded6005fc7b89cda4fdf (diff) | |
QWindowsPipeWriter: suppress a warning on unexpected peer disconnection
The other side can close the pipe at any time independently of us, so
ignore the ERROR_PIPE_NOT_CONNECTED error code if the write operation
failed.
Change-Id: I4f7ccd73c19ca2dd24fa1c9f33b5f60541a7521d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Diffstat (limited to 'src/corelib/io/qwindowspipewriter.cpp')
| -rw-r--r-- | src/corelib/io/qwindowspipewriter.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/corelib/io/qwindowspipewriter.cpp b/src/corelib/io/qwindowspipewriter.cpp index 2db3cb4060b..e1213e51853 100644 --- a/src/corelib/io/qwindowspipewriter.cpp +++ b/src/corelib/io/qwindowspipewriter.cpp @@ -262,9 +262,15 @@ bool QWindowsPipeWriter::writeCompleted(DWORD errorCode, DWORD numberOfBytesWrit lastError = errorCode; writeBuffer.clear(); - // The other end has closed the pipe. This can happen in QLocalSocket. Do not warn. - if (errorCode != ERROR_OPERATION_ABORTED && errorCode != ERROR_NO_DATA) + switch (errorCode) { + case ERROR_PIPE_NOT_CONNECTED: // the other end has closed the pipe + case ERROR_OPERATION_ABORTED: // the operation was canceled + case ERROR_NO_DATA: // the pipe is being closed + break; + default: qErrnoWarning(errorCode, "QWindowsPipeWriter: write failed."); + break; + } return false; } |
