From a02c04a51b34fc780fa680383f2aee3b3f37fa51 Mon Sep 17 00:00:00 2001 From: Niclas Rosenvik Date: Mon, 13 Apr 2015 13:03:53 +0200 Subject: 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 --- src/corelib/io/qstorageinfo_unix.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/corelib/io/qstorageinfo_unix.cpp') 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 -- cgit v1.2.3