Remove union in QFileSystemEngine

The need for this union has disappeared at some point during refactoring
It does confuse MemorySanitizer, though, so it's good to remove it.

Change-Id: I5f5050adba302bf96db96d5f303d2a25630543ce
Fixes: QTBUG-97109
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
David Skoland 2021-10-08 09:47:46 +02:00
parent 6c4dc722cb
commit 3fc58a5ed8

View File

@ -406,10 +406,7 @@ bool QFileSystemEngine::fillMetaData(int fd, QFileSystemMetaData &data)
data.entryFlags &= ~QFileSystemMetaData::PosixStatFlags;
data.knownFlagsMask |= QFileSystemMetaData::PosixStatFlags;
union {
struct statx statxBuffer;
QT_STATBUF statBuffer;
};
struct statx statxBuffer;
int ret = qt_fstatx(fd, &statxBuffer);
if (ret != -ENOSYS) {
@ -420,6 +417,8 @@ bool QFileSystemEngine::fillMetaData(int fd, QFileSystemMetaData &data)
return false;
}
QT_STATBUF statBuffer;
if (QT_FSTAT(fd, &statBuffer) == 0) {
data.fillFromStatBuf(statBuffer);
return true;