From 6275e037bfe532d12ecd76913d5d36a91c1d5034 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Tue, 18 Jun 2019 23:03:01 +0200 Subject: 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 Reviewed-by: BogDan Vatra --- src/corelib/io/qstorageinfo_unix.cpp | 4 ++-- 1 file 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 QStorageInfoPrivate::mountedVolumes() const QString mountDir = it.rootPath(); QStorageInfo info(mountDir); - if (info.bytesTotal() == 0) + if (info.bytesTotal() == 0 && info != root()) continue; volumes.append(info); } -- cgit v1.2.3