IPC/QSharedMemory: include the QSystemSemaphore error message in ours

It may be important.

Change-Id: I12a088d1ae424825abd3fffd171d6f284b69a09c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Thiago Macieira 2022-10-12 14:20:56 -07:00
parent 70487ba447
commit 1b1ab5bac9

View File

@ -267,7 +267,8 @@ bool QSharedMemoryPrivate::initKey(SemaphoreAccessMode mode)
systemSemaphore.setNativeKey(semaphoreNativeKey(), 1, mode); systemSemaphore.setNativeKey(semaphoreNativeKey(), 1, mode);
if (systemSemaphore.error() != QSystemSemaphore::NoError) { if (systemSemaphore.error() != QSystemSemaphore::NoError) {
QString function = "QSharedMemoryPrivate::initKey"_L1; QString function = "QSharedMemoryPrivate::initKey"_L1;
errorString = QSharedMemory::tr("%1: unable to set key on lock").arg(function); errorString = QSharedMemory::tr("%1: unable to set key on lock (%2)")
.arg(function, systemSemaphore.errorString());
switch(systemSemaphore.error()) { switch(systemSemaphore.error()) {
case QSystemSemaphore::PermissionDenied: case QSystemSemaphore::PermissionDenied:
error = QSharedMemory::PermissionDenied; error = QSharedMemory::PermissionDenied;