summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qstorageinfo_unix.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-11-04 12:27:37 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2015-11-04 12:28:48 +0100
commitf8246099eafbfa08910544a89c7a5047af92f54d (patch)
treeefd2a67ce5d866f4b46a2bbf804a5f9195d0d863 /src/corelib/io/qstorageinfo_unix.cpp
parent1bf639d5605863970b8dc5a91d5fc785cdf0ecf1 (diff)
parent6ed957fd7fc748143093fa335d8b4506c3ea16fa (diff)
Merge remote-tracking branch 'origin/5.5' into 5.6
Conflicts: src/corelib/io/qstorageinfo_unix.cpp src/plugins/platforms/windows/qwindowsmousehandler.cpp src/widgets/styles/qwindowsvistastyle.cpp Change-Id: Ie1725933815891cc8c86258d4c0e8ed0ab386edf
Diffstat (limited to 'src/corelib/io/qstorageinfo_unix.cpp')
-rw-r--r--src/corelib/io/qstorageinfo_unix.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/corelib/io/qstorageinfo_unix.cpp b/src/corelib/io/qstorageinfo_unix.cpp
index 262703b9e6..e365d8d7e6 100644
--- a/src/corelib/io/qstorageinfo_unix.cpp
+++ b/src/corelib/io/qstorageinfo_unix.cpp
@@ -68,8 +68,8 @@
#if defined(Q_OS_BSD4)
# if defined(Q_OS_NETBSD)
- define QT_STATFSBUF struct statvfs
- define QT_STATFS ::statvfs
+# define QT_STATFSBUF struct statvfs
+# define QT_STATFS ::statvfs
# else
# define QT_STATFSBUF struct statfs
# define QT_STATFS ::statfs
@@ -507,9 +507,15 @@ void QStorageInfoPrivate::retrieveVolumeInfo()
valid = true;
ready = true;
+#if defined(Q_OS_BSD4) && !defined(Q_OS_NETBSD)
+ bytesTotal = statfs_buf.f_blocks * statfs_buf.f_bsize;
+ bytesFree = statfs_buf.f_bfree * statfs_buf.f_bsize;
+ bytesAvailable = statfs_buf.f_bavail * statfs_buf.f_bsize;
+#else
bytesTotal = statfs_buf.f_blocks * statfs_buf.f_frsize;
bytesFree = statfs_buf.f_bfree * statfs_buf.f_frsize;
bytesAvailable = statfs_buf.f_bavail * statfs_buf.f_frsize;
+#endif
blockSize = statfs_buf.f_bsize;
#if defined(Q_OS_ANDROID) || defined (Q_OS_BSD4)
#if defined(_STATFS_F_FLAGS)