summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorAhmad Samir <a.samirh78@gmail.com>2023-11-22 16:21:37 +0200
committerAhmad Samir <a.samirh78@gmail.com>2023-11-25 00:54:54 +0200
commitea6abe583f8534495c3c43e2b6aab95742b102a3 (patch)
tree44f7af53a55cc0b2f97da0f3bc66a68f9e66ae67 /src/corelib/io
parent49f8ec54dfb94da7fc8e32d75ba98aaceccbc524 (diff)
QStorageInfo/Linux: include linux/mount.h instead of sys/mount.h
Including <sys/mount.h> in qstorageinfo_linux.cpp broke -unity-build's in which qfilesystemengine_unix.cpp (which includes <linux/fs.h> which in turn includes <linux/mount.h>) ends up in the same unity_cxx_nn.cpp as qstorageinfo_linux.cpp. MS_RDONLY is a macro in one header and an enum in another, when both are in the same TU that's UB. This was fixed[1] upstream since glibc-2.36, but it's still an issue in Ubuntu 20.04, which has an older glibc IIUC. So, just inlcude <linux/mount.h> which works on Android too (according to precheck CI on gerrit). Amends b3eb951d18abfa48bb88b5039521d79103a6a322. [1] https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E Task-number: QTBUG-119328 Change-Id: Ifa02272eea004051dd329b35f533385813215bfc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qstorageinfo_linux.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qstorageinfo_linux.cpp b/src/corelib/io/qstorageinfo_linux.cpp
index 54b487e83f..ceb5458b60 100644
--- a/src/corelib/io/qstorageinfo_linux.cpp
+++ b/src/corelib/io/qstorageinfo_linux.cpp
@@ -10,7 +10,7 @@
#include <private/qcore_unix_p.h>
#include <private/qtools_p.h>
-#include <sys/mount.h>
+#include <linux/mount.h>
#include <sys/statfs.h>
QT_BEGIN_NAMESPACE