From ea6abe583f8534495c3c43e2b6aab95742b102a3 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Wed, 22 Nov 2023 16:21:37 +0200 Subject: [PATCH] QStorageInfo/Linux: include linux/mount.h instead of sys/mount.h Including in qstorageinfo_linux.cpp broke -unity-build's in which qfilesystemengine_unix.cpp (which includes which in turn includes ) 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 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 Reviewed-by: Thiago Macieira --- src/corelib/io/qstorageinfo_linux.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 #include -#include +#include #include QT_BEGIN_NAMESPACE