diff options
author | Kai Koehne <kai.koehne@nokia.com> | 2011-05-10 13:14:16 (GMT) |
---|---|---|
committer | Kai Koehne <kai.koehne@nokia.com> | 2011-05-10 13:14:16 (GMT) |
commit | baecfbc7f7e0ec7edddb74a2e760c685977e9084 (patch) | |
tree | f9071063e3b8dfcc1b2fcb3236be84fce5b17091 /src/gui/embedded/qlock.cpp | |
parent | bde58ad1e7d2b38d2882aaf869e93b0415128836 (diff) | |
parent | f3ddd2d995b7485cdc1c3420d254499904ff9dd9 (diff) | |
download | Qt-baecfbc7f7e0ec7edddb74a2e760c685977e9084.zip Qt-baecfbc7f7e0ec7edddb74a2e760c685977e9084.tar.gz Qt-baecfbc7f7e0ec7edddb74a2e760c685977e9084.tar.bz2 |
Merge remote branch 'qt/4.8' into master-qml-staging
Conflicts:
src/declarative/debugger/qdeclarativedebugserver.cpp
src/plugins/qmltooling/qmltooling.pro
Diffstat (limited to 'src/gui/embedded/qlock.cpp')
-rw-r--r-- | src/gui/embedded/qlock.cpp | 33 |
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); |