diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2017-07-14 11:13:20 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2017-07-24 06:26:49 +0000 |
commit | 3becc8527e632e5d54e3d05d5c4f72246100c963 (patch) | |
tree | d8880c6a45792d990f1a0a5fae7498350c9f93e5 /src/corelib/io/qwindowspipewriter.cpp | |
parent | 2e2fa2a2836cfacef44d108269600c23b18e5c89 (diff) |
Let QWindowsPipeWriter::write only warn about unexpected errors
Do not print a critical message when the pipe connection dropped as this
can happen with regular QLocalSocket usage as demonstrated in
qtremoteobjects.
Change-Id: If79915ce5d83b8cae5e090c04e893dafcb5a88a7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/corelib/io/qwindowspipewriter.cpp')
-rw-r--r-- | src/corelib/io/qwindowspipewriter.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/corelib/io/qwindowspipewriter.cpp b/src/corelib/io/qwindowspipewriter.cpp index 7eb6dd0389..846891102f 100644 --- a/src/corelib/io/qwindowspipewriter.cpp +++ b/src/corelib/io/qwindowspipewriter.cpp @@ -201,7 +201,15 @@ bool QWindowsPipeWriter::write(const QByteArray &ba) writeSequenceStarted = false; numberOfBytesToWrite = 0; buffer.clear(); - qErrnoWarning("QWindowsPipeWriter::write failed."); + + const DWORD errorCode = GetLastError(); + switch (errorCode) { + case ERROR_NO_DATA: // "The pipe is being closed." + // The other end has closed the pipe. This can happen in QLocalSocket. Do not warn. + break; + default: + qErrnoWarning(errorCode, "QWindowsPipeWriter::write failed."); + } return false; } |