From 9a4d1230b54c15af6f5448c1551c35242b668ccf Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Wed, 1 Jun 2011 16:49:35 +0200 Subject: fix build with QT_NO_QWS_SIGNALHANDLER Merge-request: 1237 Reviewed-by: Harald Fernengel --- src/gui/embedded/qlock.cpp | 11 ++++++++++- src/gui/embedded/qscreenlinuxfb_qws.cpp | 5 +++++ src/gui/embedded/qwslock.cpp | 16 +++++++++++++--- src/gui/embedded/qwssignalhandler.cpp | 2 +- 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/gui/embedded/qlock.cpp b/src/gui/embedded/qlock.cpp index bb442e4..e7db7e6 100644 --- a/src/gui/embedded/qlock.cpp +++ b/src/gui/embedded/qlock.cpp @@ -173,7 +173,9 @@ QLock::QLock(const QString &filename, char id, bool create) arg.val = MAX_LOCKS; semctl(data->id,0,SETVAL,arg); +#ifndef QT_NO_QWS_SIGNALHANDLER QWSSignalHandler::instance()->addSemaphore(data->id); +#endif } #endif if (data->id == -1) { @@ -201,8 +203,15 @@ QLock::~QLock() unlink(data->file); } #else - if(data->owned) + if (data->owned) { +#ifndef QT_NO_QWS_SIGNALHANDLER QWSSignalHandler::instance()->removeSemaphore(data->id); +#else + qt_semun semval; + semval.val = 0; + semctl(data->id, 0, IPC_RMID, semval); +#endif + } #endif delete data; } diff --git a/src/gui/embedded/qscreenlinuxfb_qws.cpp b/src/gui/embedded/qscreenlinuxfb_qws.cpp index 67c8a31..4b41b5b 100644 --- a/src/gui/embedded/qscreenlinuxfb_qws.cpp +++ b/src/gui/embedded/qscreenlinuxfb_qws.cpp @@ -110,7 +110,9 @@ QLinuxFbScreenPrivate::QLinuxFbScreenPrivate() #endif ttyfd(-1), oldKdMode(KD_TEXT) { +#ifndef QT_NO_QWS_SIGNALHANDLER QWSSignalHandler::instance()->addObject(this); +#endif } QLinuxFbScreenPrivate::~QLinuxFbScreenPrivate() @@ -263,6 +265,9 @@ QLinuxFbScreen::QLinuxFbScreen(int display_id) QLinuxFbScreen::~QLinuxFbScreen() { +#ifdef QT_NO_QWS_SIGNALHANDLER + delete d_ptr; +#endif } /*! diff --git a/src/gui/embedded/qwslock.cpp b/src/gui/embedded/qwslock.cpp index a64dc3d..1d9bfb6 100644 --- a/src/gui/embedded/qwslock.cpp +++ b/src/gui/embedded/qwslock.cpp @@ -76,7 +76,9 @@ QWSLock::QWSLock() perror("QWSLock::QWSLock"); qFatal("Unable to create semaphore"); } +#ifndef QT_NO_QWS_SIGNALHANDLER QWSSignalHandler::instance()->addSemaphore(semId); +#endif qt_semun semval; semval.val = 1; @@ -103,15 +105,23 @@ QWSLock::QWSLock() QWSLock::QWSLock(int id) { semId = id; +#ifndef QT_NO_QWS_SIGNALHANDLER QWSSignalHandler::instance()->addSemaphore(semId); +#endif lockCount[0] = lockCount[1] = 0; } QWSLock::~QWSLock() { - if (semId == -1) - return; - QWSSignalHandler::instance()->removeSemaphore(semId); + if (semId != -1) { +#ifndef QT_NO_QWS_SIGNALHANDLER + QWSSignalHandler::instance()->removeSemaphore(semId); +#else + qt_semun semval; + semval.val = 0; + semctl(semId, 0, IPC_RMID, semval); +#endif + } } static bool forceLock(int semId, unsigned short semNum, int) diff --git a/src/gui/embedded/qwssignalhandler.cpp b/src/gui/embedded/qwssignalhandler.cpp index 730dbae..2a20141 100644 --- a/src/gui/embedded/qwssignalhandler.cpp +++ b/src/gui/embedded/qwssignalhandler.cpp @@ -125,4 +125,4 @@ void QWSSignalHandler::handleSignal(int signum) QT_END_NAMESPACE -#endif // QT_QWS_NO_SIGNALHANDLER +#endif // QT_NO_QWS_SIGNALHANDLER -- cgit v0.12