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>bb10
parent
2e2fa2a283
commit
3becc8527e
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue