From: Pino Toscano Date: Fri, 13 Jan 2023 07:41:54 +0000 (+0000) Subject: Limit Linux-only code with Q_OS_LINUX X-Git-Tag: archive/raspbian/5.15.8+dfsg-2+rpi1^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=70255fc5002c36696499a89367eec709cd2b3247;p=qtbase-opensource-src.git Limit Linux-only code with Q_OS_LINUX Forwarded: no Last-Update: 2020-04-19 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. Gbp-Pq: Name qstorageinfo_linux.diff --- diff --git a/src/corelib/io/qstorageinfo_unix.cpp b/src/corelib/io/qstorageinfo_unix.cpp index 698c4ddf4..45570eeea 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); }