summaryrefslogtreecommitdiffstats
path: root/src/gui/embedded/qlock.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/embedded/qlock.cpp')
-rw-r--r--src/gui/embedded/qlock.cpp33
1 files changed, 11 insertions, 22 deletions
diff --git a/src/gui/embedded/qlock.cpp b/src/gui/embedded/qlock.cpp
index b169a9b..d429b93 100644
--- a/src/gui/embedded/qlock.cpp
+++ b/src/gui/embedded/qlock.cpp
@@ -82,38 +82,27 @@ QT_END_NAMESPACE
#else // QT_NO_QWS_MULTIPROCESS
+#if defined(Q_OS_DARWIN)
+# define Q_NO_SEMAPHORE
+#endif
+
#include "qwssignalhandler_p.h"
#include <unistd.h>
#include <sys/types.h>
-#if defined(Q_OS_DARWIN)
-# define Q_NO_SEMAPHORE
-# include <sys/stat.h>
-# include <sys/file.h>
-#else // Q_OS_DARWIN
-# include <sys/sem.h>
-# if (defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED) && !defined(QT_LINUXBASE)) \
- || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD) || defined(Q_OS_NETBSD) \
- || defined(Q_OS_BSDI)
- /* union semun is defined by including <sys/sem.h> */
-# else
-/* according to X/OPEN we have to define it ourselves */
-union semun {
- int val; /* value for SETVAL */
- struct semid_ds *buf; /* buffer for IPC_STAT, IPC_SET */
- unsigned short *array; /* array for GETALL, SETALL */
-};
-# endif
-#endif // Q_OS_DARWIN
#include <sys/ipc.h>
+#if defined(Q_NO_SEMAPHORE)
+# include <sys/stat.h>
+# include <sys/file.h>
+#else
+# include <sys/sem.h>
+#endif
#include <string.h>
#include <errno.h>
#include <qdebug.h>
-#include <signal.h>
#include <private/qcore_unix_p.h> // overrides QT_OPEN
-
QT_BEGIN_NAMESPACE
#define MAX_LOCKS 200 // maximum simultaneous read locks
@@ -177,7 +166,7 @@ QLock::QLock(const QString &filename, char id, bool create)
data->id = semget(semkey,0,0);
data->owned = create;
if (create) {
- semun arg; arg.val = 0;
+ qt_semun arg; arg.val = 0;
if (data->id != -1)
semctl(data->id,0,IPC_RMID,arg);
data->id = semget(semkey,1,IPC_CREAT|0600);