diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2017-05-29 14:00:53 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2017-05-30 17:29:21 +0000 |
commit | fa3940cc4b5580070f465d1f64a23a69bc925367 (patch) | |
tree | 9eabbb5d347484247e5c45ef4638af901c084cf5 /src | |
parent | dbeb748de30bcc0e0615d21c593b761408404950 (diff) |
QStorageInfo: Pass MNT_NOWAIT to getmntinfo
This forces the API not to wait for synchronous I/O from the filesystems
and get the information, but instead just use the cached information
directly. It's a good idea if we have an unresponsive FS, like NFS with
an unreachable server.
Task-number: QTBUG-61096
Change-Id: Iddeeffb6f4ad4a2894a2fffd14c32f6e90664a63
Reviewed-by: Tobias C. Berner
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/io/qstorageinfo_unix.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/corelib/io/qstorageinfo_unix.cpp b/src/corelib/io/qstorageinfo_unix.cpp index b9c9883609..9072b34f54 100644 --- a/src/corelib/io/qstorageinfo_unix.cpp +++ b/src/corelib/io/qstorageinfo_unix.cpp @@ -195,8 +195,12 @@ static bool shouldIncludeFs(const QStorageIterator &it) #if defined(Q_OS_BSD4) +#ifndef MNT_NOWAIT +# define MNT_NOWAIT 0 +#endif + inline QStorageIterator::QStorageIterator() - : entryCount(::getmntinfo(&stat_buf, 0)), + : entryCount(::getmntinfo(&stat_buf, MNT_NOWAIT)), currentIndex(-1) { } |