Skip to content

Commit 1eba67b

Browse files
fix compilarion errors.
1 parent 0e81f5b commit 1eba67b

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

.github/workflows/actions.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ jobs:
364364
vs-version: '[17,18)' # 17.xx
365365
msbuild-architecture: x64
366366
- name: Install Qt
367-
uses: jurplel/install-qt-action@v4
367+
uses: jurplel/install-qt-action@v4.1
368368
with:
369369
version: 6.8.0
370370
host: windows
@@ -414,7 +414,7 @@ jobs:
414414
steps:
415415
- uses: actions/checkout@main
416416
- name: Install Qt
417-
uses: jurplel/install-qt-action@v4
417+
uses: jurplel/install-qt-action@v4.1
418418
with:
419419
version: 6.8.0
420420
host: windows
@@ -466,7 +466,7 @@ jobs:
466466
steps:
467467
- uses: actions/checkout@main
468468
- name: Install Qt
469-
uses: jurplel/install-qt-action@v4
469+
uses: jurplel/install-qt-action@v4.1
470470
with:
471471
version: 6.5.2
472472
host: windows

src/tsharedmemory_linux.cpp

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,26 @@
66
*/
77

88
#include "tsharedmemory.h"
9+
#include <TSystemGlobal>
910
#include <pthread.h>
11+
#include <errno.h>
1012

1113

12-
void TSharedMemory::initRwlock(header_t *header) const
14+
bool TSharedMemory::initRwlock(header_t *header) const
1315
{
16+
int res = -1;
1417
pthread_rwlockattr_t attr;
1518

16-
int res = pthread_rwlockattr_init(&attr);
17-
Q_ASSERT(!res);
18-
res = pthread_rwlockattr_setpshared(&attr, PTHREAD_PROCESS_SHARED); // Linux only
19-
Q_ASSERT(!res);
20-
res = pthread_rwlock_init(&header->rwlock, &attr);
21-
Q_ASSERT(!res);
19+
if (header) {
20+
res = pthread_rwlockattr_init(&attr);
21+
Q_ASSERT(!res);
22+
res = pthread_rwlockattr_setpshared(&attr, PTHREAD_PROCESS_SHARED); // Linux only
23+
Q_ASSERT(!res);
24+
if ((res = pthread_rwlock_init(&header->rwlock, &attr)) < 0) {
25+
tSystemError("pthread_rwlock_init failed: {}", (const char*)strerror(errno));
26+
}
27+
}
28+
return !res;
2229
}
2330

2431

0 commit comments

Comments
 (0)