QFileSystemEngine/Linux: correct a minor problem with lstatx() failures
Our wrappers around the statx(2) system call on Linux return the negative of errno, to avoid setting errno and reading it back for the OSes where the system call doesn't apply. That means the vast majority of errors from qt_lstatx() will not be -1 (the most common being -2 for ENOENT) and we'd thus not enter the next block: // second, we try a regular stat(2) if (statResult == -1 && (what & QFileSystemMetaData::PosixStatFlags)) { Pick-to: 6.8 Change-Id: I489e7c9ee1327fb98510fffd315c66948956534f Reviewed-by: Ahmad Samir <a.samirh78@gmail.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit c5e6034bbd99459373279f8ae3dcac0f87c1f39c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 5f758f7af6705d4b7f12bac1a0e16782e1b7126d)
This commit is contained in:
parent
15b2a2d577
commit
a94a020e77
@ -966,6 +966,7 @@ bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemM
|
||||
} else {
|
||||
// it doesn't exist
|
||||
entryErrno = errno;
|
||||
statResult = -1;
|
||||
data.knownFlagsMask |= QFileSystemMetaData::ExistsAttribute;
|
||||
}
|
||||
|
||||
@ -974,7 +975,7 @@ bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemM
|
||||
|
||||
// second, we try a regular stat(2)
|
||||
if (statResult == -1 && (what & QFileSystemMetaData::PosixStatFlags)) {
|
||||
if (entryErrno == 0 && statResult == -1) {
|
||||
if (entryErrno == 0) {
|
||||
data.entryFlags &= ~QFileSystemMetaData::PosixStatFlags;
|
||||
statResult = qt_statx(nativeFilePath, &statxBuffer);
|
||||
if (statResult == -ENOSYS) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user