diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2019-06-18 23:03:01 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2019-06-18 23:03:01 +0200 |
commit | 6275e037bfe532d12ecd76913d5d36a91c1d5034 (patch) | |
tree | b15a0bc51b02ed2071e05ba7e9baf69153a4e1b1 /src/corelib | |
parent | cdfe8c76af1518ccdd497c20ecc189365c733879 (diff) |
Android: Make sure that the root file system is in the list of volumes
On Android (at least in the emulator), the root file system is reported
to be of type rootfs, which we usually ignore on Linux as legacy.
Also, it's a read-only file system with bytesTotal reported as zero. We
usually ignore such volumes, but as the root file system is expected to
be in the list, we should never ignore it.
This fixes the failing QStorageInfo test.
Change-Id: I778ee9e76e385649e58d5e5ac7e0ae2d8e0ba92b
Fixes: QTBUG-73563
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/io/qstorageinfo_unix.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/io/qstorageinfo_unix.cpp b/src/corelib/io/qstorageinfo_unix.cpp index b7621b5d2f..6b821b0fe9 100644 --- a/src/corelib/io/qstorageinfo_unix.cpp +++ b/src/corelib/io/qstorageinfo_unix.cpp @@ -220,7 +220,7 @@ static bool shouldIncludeFs(const QStorageIterator &it) return false; } -#ifdef Q_OS_LINUX +#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID) if (it.fileSystemType() == "rootfs") return false; #endif @@ -846,7 +846,7 @@ QList<QStorageInfo> QStorageInfoPrivate::mountedVolumes() const QString mountDir = it.rootPath(); QStorageInfo info(mountDir); - if (info.bytesTotal() == 0) + if (info.bytesTotal() == 0 && info != root()) continue; volumes.append(info); } |