store native file path outside loop in QFSFileEngine::open()

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-01-08 13:38:11 +02:00
parent 7ced9a4e78
commit a4bb0a9759

View file

@ -181,8 +181,9 @@ bool QFSFileEngine::open(QIODevice::OpenMode openMode)
}
// Try to open the file.
QByteArray native = d->fileEntry.nativeFilePath();
do {
d->fd = QT_OPEN(d->fileEntry.nativeFilePath().constData(), flags, 0666);
d->fd = QT_OPEN(native.constData(), flags, 0666);
} while (d->fd == -1 && errno == EINTR);
// On failure, return and report the error.