summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorNiclas Rosenvik <nros@netbsd.org>2015-04-13 13:03:53 +0200
committerThiago Macieira <thiago.macieira@intel.com>2015-04-13 18:38:17 +0000
commita02c04a51b34fc780fa680383f2aee3b3f37fa51 (patch)
tree1434059f6ad5c546284a88bbd33c0ccb9bf0195a /src/corelib/io
parent96cc8eec9b32f4e80c2d748687c485bc79133d39 (diff)
qstorageinfo_unix.cpp: fixes for NetBSD and solaris
NetBSD uses struct statvfs ** as first argument to getmntinfo. see: http://netbsd.gw.com/cgi-bin/man-cgi?getmntinfo getmntent on solaris and sunos returns an integer not a pointer. see: http://www.unix.com/man-page/opensolaris/3c/getmntent/ see: https://smartos.org/man/3C/getmntent Change-Id: Ic01da0edcf1f55617294e5a86b8459669e82c1b1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qstorageinfo_unix.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/corelib/io/qstorageinfo_unix.cpp b/src/corelib/io/qstorageinfo_unix.cpp
index 45b32830cd..7b8f608050 100644
--- a/src/corelib/io/qstorageinfo_unix.cpp
+++ b/src/corelib/io/qstorageinfo_unix.cpp
@@ -122,7 +122,11 @@ public:
inline QByteArray device() const;
private:
#if defined(Q_OS_BSD4)
+# if defined(Q_OS_NETBSD)
+ struct statvfs *stat_buf;
+# else
struct statfs *stat_buf;
+# endif
int entryCount;
int currentIndex;
#elif defined(Q_OS_SOLARIS)
@@ -206,7 +210,7 @@ inline bool QStorageIterator::isValid() const
inline bool QStorageIterator::next()
{
- return ::getmntent(fp, &mnt) == Q_NULLPTR;
+ return ::getmntent(fp, &mnt) == 0;
}
inline QString QStorageIterator::rootPath() const