File: qstorageinfo_linux.diff

package info (click to toggle)
qtbase-opensource-src 5.15.17%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 351,148 kB
  • sloc: cpp: 2,097,620; ansic: 343,242; xml: 115,491; python: 9,447; java: 7,499; asm: 4,023; sh: 2,090; perl: 2,047; yacc: 1,687; lex: 1,333; javascript: 878; makefile: 271; objc: 70
file content (28 lines) | stat: -rw-r--r-- 1,026 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Author: Pino Toscano <toscano.pino@tiscali.it>
Description: 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

--- a/src/corelib/io/qstorageinfo_unix.cpp
+++ b/src/corelib/io/qstorageinfo_unix.cpp
@@ -566,6 +566,7 @@ inline QByteArray QStorageIterator::file
 
 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::devi
             return dev;
         }
     }
+#endif
     return QByteArray(mnt.mnt_fsname);
 }