diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-04-23 09:55:02 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-07-02 11:29:36 (GMT) |
commit | cad1bf4c902899ec1a8277d46272afa23fc2b34b (patch) | |
tree | bc4c4f318893d2d8723b4898fc4edcf544eb4b83 /src/gui/embedded/qmousevfb_qws.cpp | |
parent | 27fc6ef5dfb7d58af778de162298fdc4da34459f (diff) | |
download | Qt-cad1bf4c902899ec1a8277d46272afa23fc2b34b.zip Qt-cad1bf4c902899ec1a8277d46272afa23fc2b34b.tar.gz Qt-cad1bf4c902899ec1a8277d46272afa23fc2b34b.tar.bz2 |
Port gui/embedded to the EINTR-safe functions.
I think I found two file descriptor that aren't closed. One seems like
a genuine leak, the other seems intentional.
Reviewed-By: ossi
Diffstat (limited to 'src/gui/embedded/qmousevfb_qws.cpp')
-rw-r--r-- | src/gui/embedded/qmousevfb_qws.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/embedded/qmousevfb_qws.cpp b/src/gui/embedded/qmousevfb_qws.cpp index 17d051f..dd553bc 100644 --- a/src/gui/embedded/qmousevfb_qws.cpp +++ b/src/gui/embedded/qmousevfb_qws.cpp @@ -54,6 +54,7 @@ #include <qsocketnotifier.h> #include <qapplication.h> #include <qtimer.h> +#include <private/qcore_unix_p.h> // overrides QT_OPEN QT_BEGIN_NAMESPACE @@ -64,7 +65,7 @@ QVFbMouseHandler::QVFbMouseHandler(const QString &driver, const QString &device) if (device.isEmpty()) mouseDev = QLatin1String("/dev/vmouse"); - mouseFD = open(mouseDev.toLatin1().constData(), O_RDWR | O_NDELAY); + mouseFD = QT_OPEN(mouseDev.toLatin1().constData(), O_RDWR | O_NDELAY); if (mouseFD == -1) { perror("QVFbMouseHandler::QVFbMouseHandler"); qWarning("QVFbMouseHander: Unable to open device %s", @@ -74,7 +75,7 @@ QVFbMouseHandler::QVFbMouseHandler(const QString &driver, const QString &device) // Clear pending input char buf[2]; - while (read(mouseFD, buf, 1) > 0) { } + while (QT_READ(mouseFD, buf, 1) > 0) { } mouseIdx = 0; @@ -85,7 +86,7 @@ QVFbMouseHandler::QVFbMouseHandler(const QString &driver, const QString &device) QVFbMouseHandler::~QVFbMouseHandler() { if (mouseFD >= 0) - close(mouseFD); + QT_CLOSE(mouseFD); } void QVFbMouseHandler::resume() @@ -102,7 +103,7 @@ void QVFbMouseHandler::readMouseData() { int n; do { - n = read(mouseFD, mouseBuf+mouseIdx, mouseBufSize-mouseIdx); + n = QT_READ(mouseFD, mouseBuf+mouseIdx, mouseBufSize-mouseIdx); if (n > 0) mouseIdx += n; } while (n > 0); |