summaryrefslogtreecommitdiffstats
path: root/tools/qvfb
diff options
context:
space:
mode:
authorRitt Konstantin <ritt.ks@gmail.com>2011-07-14 12:49:56 (GMT)
committerHarald Fernengel <harald.fernengel@nokia.com>2011-07-14 12:49:56 (GMT)
commit1093d3363df4260cc738ccc1649d710414f07cb3 (patch)
treeb4a77785120e17d9f00b6e6f115f7c839582c588 /tools/qvfb
parent90dac1e856e4d3648ce19ae6b356f9aeb090af49 (diff)
downloadQt-1093d3363df4260cc738ccc1649d710414f07cb3.zip
Qt-1093d3363df4260cc738ccc1649d710414f07cb3.tar.gz
Qt-1093d3363df4260cc738ccc1649d710414f07cb3.tar.bz2
get rid of unwanted dependencies and unused header includes
Merge-request: 1295 Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
Diffstat (limited to 'tools/qvfb')
-rw-r--r--tools/qvfb/qvfbmmap.cpp2
-rw-r--r--tools/qvfb/qvfbshmem.cpp25
-rw-r--r--tools/qvfb/qvfbview.cpp5
3 files changed, 6 insertions, 26 deletions
diff --git a/tools/qvfb/qvfbmmap.cpp b/tools/qvfb/qvfbmmap.cpp
index 7e80e37..01c1d9c 100644
--- a/tools/qvfb/qvfbmmap.cpp
+++ b/tools/qvfb/qvfbmmap.cpp
@@ -48,9 +48,7 @@
#include <unistd.h>
#include <sys/ipc.h>
#include <sys/types.h>
-#include <sys/shm.h>
#include <sys/stat.h>
-#include <sys/sem.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <errno.h>
diff --git a/tools/qvfb/qvfbshmem.cpp b/tools/qvfb/qvfbshmem.cpp
index b05b69c..c17a680 100644
--- a/tools/qvfb/qvfbshmem.cpp
+++ b/tools/qvfb/qvfbshmem.cpp
@@ -39,10 +39,9 @@
**
****************************************************************************/
-#include "qlock_p.h"
-
#include "qvfbshmem.h"
-#include "qvfbhdr.h"
+#include <qvfbhdr.h>
+#include <private/qlock_p.h>
#include <QFile>
#include <QTimer>
@@ -53,8 +52,6 @@
#include <sys/types.h>
#include <sys/shm.h>
#include <sys/stat.h>
-#include <sys/sem.h>
-#include <sys/mman.h>
#include <fcntl.h>
#include <errno.h>
#include <math.h>
@@ -143,20 +140,10 @@ QShMemViewProtocol::QShMemViewProtocol(int displayid, const QSize &s,
qws_dataDir(displayid);
- QString oldPipe = "/tmp/qtembedded-" + username + "/" + QString("QtEmbedded-%1").arg(displayid);
- int oldPipeSemkey = ftok(oldPipe.toLatin1().constData(), 'd');
- if (oldPipeSemkey != -1) {
- int oldPipeLockId = semget(oldPipeSemkey, 0, 0);
- if (oldPipeLockId >= 0){
- sembuf sops;
- sops.sem_num = 0;
- sops.sem_op = 1;
- sops.sem_flg = SEM_UNDO;
- int rv;
- do {
- rv = semop(lockId,&sops,1);
- } while (rv == -1 && errno == EINTR);
-
+ {
+ QString oldPipe = "/tmp/qtembedded-" + username + "/" + QString("QtEmbedded-%1").arg(displayid);
+ QLock oldPipeLock(oldPipe, 'd', false);
+ if (oldPipeLock.isValid()) {
perror("QShMemViewProtocol::QShMemViewProtocol");
qFatal("Cannot create lock file as an old version of QVFb has "
"opened %s. Close other QVFb and try again",
diff --git a/tools/qvfb/qvfbview.cpp b/tools/qvfb/qvfbview.cpp
index 3f13ecc..91c5380 100644
--- a/tools/qvfb/qvfbview.cpp
+++ b/tools/qvfb/qvfbview.cpp
@@ -61,12 +61,7 @@
#include <stdlib.h>
#include <unistd.h>
-#include <sys/ipc.h>
#include <sys/types.h>
-#include <sys/shm.h>
-#include <sys/stat.h>
-#include <sys/sem.h>
-#include <fcntl.h>
#include <errno.h>
#include <math.h>