summaryrefslogtreecommitdiffstats
path: root/src/gui/embedded/qsoundqss_qws.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-04-23 09:55:02 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-07-02 11:29:36 (GMT)
commitcad1bf4c902899ec1a8277d46272afa23fc2b34b (patch)
treebc4c4f318893d2d8723b4898fc4edcf544eb4b83 /src/gui/embedded/qsoundqss_qws.cpp
parent27fc6ef5dfb7d58af778de162298fdc4da34459f (diff)
downloadQt-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/qsoundqss_qws.cpp')
-rw-r--r--src/gui/embedded/qsoundqss_qws.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/embedded/qsoundqss_qws.cpp b/src/gui/embedded/qsoundqss_qws.cpp
index ac0ac9d..a45d0fe 100644
--- a/src/gui/embedded/qsoundqss_qws.cpp
+++ b/src/gui/embedded/qsoundqss_qws.cpp
@@ -53,6 +53,7 @@
#include <qtimer.h>
#include <qpointer.h>
#include <qendian.h>
+#include <private/qcore_unix_p.h> // overrides QT_OPEN
#include <unistd.h>
#include <stdlib.h>
@@ -1137,7 +1138,7 @@ void QWSSoundServerPrivate::sendCompletedSignals()
int QWSSoundServerPrivate::openFile(int wid, int sid, const QString& filename)
{
stopFile(wid, sid); // close and re-open.
- int f = ::open(QFile::encodeName(filename), O_RDONLY|O_NONBLOCK);
+ int f = QT_OPEN(QFile::encodeName(filename), O_RDONLY|O_NONBLOCK);
if (f == -1) {
// XXX check ferror, check reason.
qDebug("Failed opening \"%s\"",filename.toLatin1().data());
@@ -1157,7 +1158,7 @@ bool QWSSoundServerPrivate::openDevice()
{
if (fd < 0) {
if( silent ) {
- fd = ::open( "/dev/null", O_WRONLY );
+ fd = QT_OPEN( "/dev/null", O_WRONLY );
// Emulate write to audio device
int delay = 1000*(sound_buffer_size>>(sound_stereo+sound_16bit))/sound_speed/2;
timerId = startTimer(delay);
@@ -1168,7 +1169,7 @@ bool QWSSoundServerPrivate::openDevice()
// Don't block open right away.
//
bool openOkay = false;
- if ((fd = ::open("/dev/dsp", O_WRONLY|O_NONBLOCK)) != -1) {
+ if ((fd = QT_OPEN("/dev/dsp", O_WRONLY|O_NONBLOCK)) != -1) {
int flags = fcntl(fd, F_GETFL);
flags &= ~O_NONBLOCK;
openOkay = (fcntl(fd, F_SETFL, flags) == 0);
@@ -1222,7 +1223,7 @@ bool QWSSoundServerPrivate::openDevice()
//
// Check system volume
//
- int mixerHandle = ::open( "/dev/mixer", O_RDWR|O_NONBLOCK );
+ int mixerHandle = QT_OPEN( "/dev/mixer", O_RDWR|O_NONBLOCK );
if ( mixerHandle >= 0 ) {
int volume;
ioctl( mixerHandle, MIXER_READ(0), &volume );