diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/kernel/qsystemsemaphore_unix.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/corelib/kernel/qsystemsemaphore_unix.cpp b/src/corelib/kernel/qsystemsemaphore_unix.cpp index 07e3618..9d0c0b9 100644 --- a/src/corelib/kernel/qsystemsemaphore_unix.cpp +++ b/src/corelib/kernel/qsystemsemaphore_unix.cpp @@ -56,6 +56,8 @@ #include <sys/sem.h> +#include "private/qcore_unix_p.h" + // OpenBSD 4.2 doesn't define EIDRM, see BUGS section: // http://www.openbsd.org/cgi-bin/man.cgi?query=semop&manpath=OpenBSD+4.2 #if defined(Q_OS_OPENBSD) && !defined(EIDRM) @@ -218,7 +220,10 @@ bool QSystemSemaphorePrivate::modifySemaphore(int count) operation.sem_num = 0; operation.sem_op = count; operation.sem_flg = SEM_UNDO; - if (-1 == semop(semaphore, &operation, 1)) { + + register int res; + EINTR_LOOP(res, semop(semaphore, &operation, 1)); + if (-1 == res) { // If the semaphore was removed be nice and create it and then modifySemaphore again if (errno == EINVAL || errno == EIDRM) { semaphore = -1; |