set error from errno before calling close() in QFileSystemEngine::copyFile()

Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
Ivailo Monev 2019-12-14 22:49:47 +00:00
parent 05982d0b07
commit 06526cb868

View file

@ -397,8 +397,8 @@ bool QFileSystemEngine::copyFile(const QFileSystemEntry &source, const QFileSyst
const int targetfd = QT_CREAT(target.nativeFilePath().constData(), st.st_mode);
if (targetfd == -1) {
::close(sourcefd);
error = QSystemError(errno, QSystemError::StandardLibraryError);
::close(sourcefd);
return false;
}