qt: Fix IODeviceDataProvider with Process

* lang/qt/src/dataprovider.cpp (blocking_read): Keep
reading if process is not atEnd.

--
This fixes a regression in Kleopatra that uses this dataprovider
to chain the gpgtar process to the encryption / signing.
This commit is contained in:
Andre Heinecke 2017-11-14 14:28:32 +01:00
parent 00daac1553
commit 56b27b21d5
No known key found for this signature in database
GPG Key ID: 2978E9D40CBABA5C

View File

@ -185,7 +185,11 @@ static qint64 blocking_read(const std::shared_ptr<QIODevice> &io, char *buffer,
if (p->error() == QProcess::UnknownError &&
p->exitStatus() == QProcess::NormalExit &&
p->exitCode() == 0) {
if (io->atEnd()) {
// EOF
return 0;
} // continue reading even if process ended to ensure
// everything is read.
} else {
Error::setSystemError(GPG_ERR_EIO);
return -1;