summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/kernel/qsharedmemory_win.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/corelib/kernel/qsharedmemory_win.cpp b/src/corelib/kernel/qsharedmemory_win.cpp
index 3b8876f..567214e 100644
--- a/src/corelib/kernel/qsharedmemory_win.cpp
+++ b/src/corelib/kernel/qsharedmemory_win.cpp
@@ -142,14 +142,10 @@ bool QSharedMemoryPrivate::create(int size)
// Create the file mapping.
hand = CreateFileMapping(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, 0, size, (wchar_t*)nativeKey.utf16());
+ setErrorString(QLatin1String("QSharedMemory::create"));
// hand is valid when it already exists unlike unix so explicitly check
- if (error == QSharedMemory::AlreadyExists || !hand) {
- setErrorString(QLatin1String("QSharedMemory::create"));
- return false;
- }
-
- return true;
+ return !(error == QSharedMemory::AlreadyExists || !hand);
}
bool QSharedMemoryPrivate::attach(QSharedMemory::AccessMode mode)