summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2020-01-28 16:59:59 -0800
committerKarim Pinter <karim.pinter@qt.io>2020-02-10 13:26:41 +0200
commit52c0c4efccee5388b64ead635c7c973713e75318 (patch)
treea64699595fe95adc661cdfce665938b98f059130 /src
parent0cf046cc7cc84ba822f43183f162989b2c078913 (diff)
QLockFile: Disable flock() on QNX
It appears it's not implemented. [ChangeLog][QtCore][QLockFile] Suppressed the warning on QNX that said 'setNativeLocks failed: "Function not implemented"'. There is no difference in behavior: Qt will continue not to be able to apply an OS- level file lock, which means the lock could be accidentally stolen by buggy software. Correct software using QLockFile should not be affected. Fixes: QTBUG-81701 Change-Id: If79a52e476594446baccfffd15ee35bbac6c6e47 Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit 9ede07613dc5b7759f398d5a8839b2ffdb4675a2) Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qlockfile_unix.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/io/qlockfile_unix.cpp b/src/corelib/io/qlockfile_unix.cpp
index 418b7d22ba..14fa044089 100644
--- a/src/corelib/io/qlockfile_unix.cpp
+++ b/src/corelib/io/qlockfile_unix.cpp
@@ -58,6 +58,12 @@
#include <sys/file.h> // flock
#endif
+#if defined(Q_OS_RTEMS) || defined(Q_OS_QNX)
+// flock() does not work in these OSes and produce warnings when we try to use
+# undef LOCK_EX
+# undef LOCK_NB
+#endif
+
#include <sys/types.h> // kill
#include <signal.h> // kill
#include <unistd.h> // gethostname