qtbase-opensource-src/debian/patches/qstorageinfo_linux.diff

36 lines
1.3 KiB
Diff

From: Pino Toscano <toscano.pino@tiscali.it>
Date: Sat, 14 May 2022 17:41:01 +0800
Subject: Limit Linux-only code with Q_OS_LINUX
The QStorageInfo/QStorageIterator implementation used for Linux is used also
on Hurd, as it uses an interface provided by GNU libc.
QStorageIterator::device() tries to use PATH_MAX (unavailable on the Hurd)
to lookup a /dev/block/ path, which exists on Linux only; hence, perform that
check within a Q_OS_LINUX block.
Forwarded: no
Last-Update: 2020-04-19
---
src/corelib/io/qstorageinfo_unix.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/corelib/io/qstorageinfo_unix.cpp b/src/corelib/io/qstorageinfo_unix.cpp
index 698c4dd..45570ee 100644
--- a/src/corelib/io/qstorageinfo_unix.cpp
+++ b/src/corelib/io/qstorageinfo_unix.cpp
@@ -566,6 +566,7 @@ inline QByteArray QStorageIterator::fileSystemType() const
inline QByteArray QStorageIterator::device() const
{
+#ifdef Q_OS_LINUX
// check that the device exists
if (mnt.mnt_fsname[0] == '/' && access(mnt.mnt_fsname, F_OK) != 0) {
// It doesn't, so let's try to resolve the dev_t from /dev/block.
@@ -581,6 +582,7 @@ inline QByteArray QStorageIterator::device() const
return dev;
}
}
+#endif
return QByteArray(mnt.mnt_fsname);
}