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>
This commit is contained in:
Niclas Rosenvik 2015-04-13 13:03:53 +02:00 committed by Thiago Macieira
parent 96cc8eec9b
commit a02c04a51b

View File

@ -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