diff options
author | Alex Trotsenko <alex1973tr@gmail.com> | 2021-06-21 15:33:52 +0300 |
---|---|---|
committer | Alex Trotsenko <alex1973tr@gmail.com> | 2021-06-21 22:32:31 +0300 |
commit | 08b4abe1ba64d8a945c6a5a1a3cf01df1b8d6c88 (patch) | |
tree | bfe23e920145e278908a06138402149d485af7eb | |
parent | 991b64a7e5bd8c46750afe0b7f47aa848ef34ce0 (diff) |
QWindowsPipeReader::read(): remove redundant checks
An initial EOF check is not required here because the code below
correctly handles this case. Also, the condition '!pipeBroken' means
that the pipe reader is in the 'Running' state.
Change-Id: I608d932c4e38f8224d9e655272e61295e55414e0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
-rw-r--r-- | src/corelib/io/qwindowspipereader.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/corelib/io/qwindowspipereader.cpp b/src/corelib/io/qwindowspipereader.cpp index 4d2f008eeb..b417b4fd50 100644 --- a/src/corelib/io/qwindowspipereader.cpp +++ b/src/corelib/io/qwindowspipereader.cpp @@ -186,9 +186,6 @@ qint64 QWindowsPipeReader::bytesAvailable() const */ qint64 QWindowsPipeReader::read(char *data, qint64 maxlen) { - if (pipeBroken && actualReadBufferSize == 0) - return 0; // signal EOF - mutex.lock(); qint64 readSoFar; // If startAsyncRead() has read data, copy it to its destination. @@ -203,8 +200,7 @@ qint64 QWindowsPipeReader::read(char *data, qint64 maxlen) mutex.unlock(); if (!pipeBroken) { - if (state == Running) - startAsyncRead(); + startAsyncRead(); if (readSoFar == 0) return -2; // signal EWOULDBLOCK } |