From 1b1ab5bac92dbb67c0999c96fb8348a90066ff83 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 12 Oct 2022 14:20:56 -0700 Subject: [PATCH] IPC/QSharedMemory: include the QSystemSemaphore error message in ours It may be important. Change-Id: I12a088d1ae424825abd3fffd171d6f284b69a09c Reviewed-by: Fabian Kosmale --- src/corelib/ipc/qsharedmemory.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/ipc/qsharedmemory.cpp b/src/corelib/ipc/qsharedmemory.cpp index 5dac2f775f..501036a650 100644 --- a/src/corelib/ipc/qsharedmemory.cpp +++ b/src/corelib/ipc/qsharedmemory.cpp @@ -267,7 +267,8 @@ bool QSharedMemoryPrivate::initKey(SemaphoreAccessMode mode) systemSemaphore.setNativeKey(semaphoreNativeKey(), 1, mode); if (systemSemaphore.error() != QSystemSemaphore::NoError) { 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()) { case QSystemSemaphore::PermissionDenied: error = QSharedMemory::PermissionDenied;