diff --git a/src/corelib/io/qwindowspipewriter.cpp b/src/corelib/io/qwindowspipewriter.cpp index e1213e5185..182c3e3c6f 100644 --- a/src/corelib/io/qwindowspipewriter.cpp +++ b/src/corelib/io/qwindowspipewriter.cpp @@ -126,41 +126,38 @@ qint64 QWindowsPipeWriter::bytesToWrite() const /*! Writes a shallow copy of \a ba to the internal buffer. */ -bool QWindowsPipeWriter::write(const QByteArray &ba) +void QWindowsPipeWriter::write(const QByteArray &ba) { - return writeImpl(ba); + writeImpl(ba); } /*! Writes data to the internal buffer. */ -bool QWindowsPipeWriter::write(const char *data, qint64 size) +void QWindowsPipeWriter::write(const char *data, qint64 size) { - return writeImpl(data, size); + writeImpl(data, size); } template -inline bool QWindowsPipeWriter::writeImpl(Args... args) +inline void QWindowsPipeWriter::writeImpl(Args... args) { QMutexLocker locker(&mutex); if (lastError != ERROR_SUCCESS) - return false; + return; writeBuffer.append(args...); if (writeSequenceStarted) - return true; + return; stopped = false; // If we don't have an assigned handle yet, defer writing until // setHandle() is called. - if (handle == INVALID_HANDLE_VALUE) - return true; - - startAsyncWriteLocked(&locker); - return true; + if (handle != INVALID_HANDLE_VALUE) + startAsyncWriteLocked(&locker); } /*! diff --git a/src/corelib/io/qwindowspipewriter_p.h b/src/corelib/io/qwindowspipewriter_p.h index 8a3b3068e5..ebd48260ba 100644 --- a/src/corelib/io/qwindowspipewriter_p.h +++ b/src/corelib/io/qwindowspipewriter_p.h @@ -68,8 +68,8 @@ public: ~QWindowsPipeWriter(); void setHandle(HANDLE hPipeWriteEnd); - bool write(const QByteArray &ba); - bool write(const char *data, qint64 size); + void write(const QByteArray &ba); + void write(const char *data, qint64 size); void stop(); bool checkForWrite() { return consumePendingAndEmit(false); } qint64 bytesToWrite() const; @@ -83,7 +83,7 @@ protected: private: template - inline bool writeImpl(Args... args); + inline void writeImpl(Args... args); void startAsyncWriteLocked(QMutexLocker *locker); static void CALLBACK waitCallback(PTP_CALLBACK_INSTANCE instance, PVOID context,