From 3becc8527e632e5d54e3d05d5c4f72246100c963 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 14 Jul 2017 11:13:20 +0200 Subject: 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 --- src/corelib/io/qwindowspipewriter.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3