summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dist/changes-5.9.04
-rw-r--r--src/corelib/kernel/qcore_unix_p.h14
-rw-r--r--src/corelib/kernel/qsharedmemory_systemv.cpp2
-rw-r--r--src/corelib/kernel/qsystemsemaphore_systemv.cpp2
4 files changed, 6 insertions, 16 deletions
diff --git a/dist/changes-5.9.0 b/dist/changes-5.9.0
index 3545ed411c..6d13e5c6ce 100644
--- a/dist/changes-5.9.0
+++ b/dist/changes-5.9.0
@@ -32,6 +32,10 @@ information about a particular change.
- [QTBUG-59849] QSysInfo::productType() and QFileSelector behavior on
macOS was restored to match what Qt used to return in version 5.7.0 and
earlier. The behavior found in Qt 5.6.2, 5.7.1 and 5.8.0 is removed.
+ - [QTBUG-60771] Reverted a change that caused Qt 5.6 through 5.8 not to
+ connect to QSystemSemaphore and QSharedMemory created by running
+ applications using Qt earlier than 5.6. Unfortunately, this means that Qt
+ 5.9 will not connect to 5.6-5.8.
- QTouchEvent
* Touch point ids are now unique even between different devices. As a
diff --git a/src/corelib/kernel/qcore_unix_p.h b/src/corelib/kernel/qcore_unix_p.h
index 8f37aec6e2..86bace3260 100644
--- a/src/corelib/kernel/qcore_unix_p.h
+++ b/src/corelib/kernel/qcore_unix_p.h
@@ -55,7 +55,6 @@
#include <QtCore/private/qglobal_p.h>
#include "qplatformdefs.h"
#include "qatomic.h"
-#include "qhash.h"
#ifndef Q_OS_UNIX
# error "qcore_unix_p.h included on a non-Unix system"
@@ -369,19 +368,6 @@ union qt_semun {
unsigned short *array; /* array for GETALL, SETALL */
};
-#ifndef QT_POSIX_IPC
-#if QT_CONFIG(sharedmemory) || QT_CONFIG(systemsemaphore)
-#ifndef Q_OS_ANDROID
-static inline key_t qt_safe_ftok(const QByteArray &filename, int proj_id)
-{
- // Unfortunately ftok can return colliding keys even for different files.
- // Try to add some more entropy via qHash.
- return ::ftok(filename.constData(), qHash(filename, proj_id));
-}
-#endif // !Q_OS_ANDROID
-#endif // QT_CONFIG(sharedmemory) || QT_CONFIG(systemsemaphore)
-#endif // !QT_POSIX_IPC
-
QT_END_NAMESPACE
#endif
diff --git a/src/corelib/kernel/qsharedmemory_systemv.cpp b/src/corelib/kernel/qsharedmemory_systemv.cpp
index 339ee9afe2..fea4a65b5c 100644
--- a/src/corelib/kernel/qsharedmemory_systemv.cpp
+++ b/src/corelib/kernel/qsharedmemory_systemv.cpp
@@ -88,7 +88,7 @@ key_t QSharedMemoryPrivate::handle()
return 0;
}
- unix_key = qt_safe_ftok(QFile::encodeName(nativeKey), 'Q');
+ unix_key = ftok(QFile::encodeName(nativeKey).constData(), 'Q');
if (-1 == unix_key) {
errorString = QSharedMemory::tr("%1: ftok failed").arg(QLatin1String("QSharedMemory::handle:"));
error = QSharedMemory::KeyError;
diff --git a/src/corelib/kernel/qsystemsemaphore_systemv.cpp b/src/corelib/kernel/qsystemsemaphore_systemv.cpp
index 83da09da44..9e438ae2a6 100644
--- a/src/corelib/kernel/qsystemsemaphore_systemv.cpp
+++ b/src/corelib/kernel/qsystemsemaphore_systemv.cpp
@@ -104,7 +104,7 @@ key_t QSystemSemaphorePrivate::handle(QSystemSemaphore::AccessMode mode)
#if !defined(QT_NO_SHAREDMEMORY) && !defined(QT_POSIX_IPC) && !defined(Q_OS_ANDROID)
// Get the unix key for the created file
- unix_key = qt_safe_ftok(QFile::encodeName(fileName), 'Q');
+ unix_key = ftok(QFile::encodeName(fileName).constData(), 'Q');
#endif
if (-1 == unix_key) {
errorString =