summaryrefslogtreecommitdiffstats
path: root/src/gui/embedded/qtransportauth_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/qtransportauth_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/qtransportauth_qws.cpp')
-rw-r--r--src/gui/embedded/qtransportauth_qws.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/embedded/qtransportauth_qws.cpp b/src/gui/embedded/qtransportauth_qws.cpp
index 05dce11..8523e27 100644
--- a/src/gui/embedded/qtransportauth_qws.cpp
+++ b/src/gui/embedded/qtransportauth_qws.cpp
@@ -56,6 +56,7 @@
#include "qlibraryinfo.h"
#include "qfile.h"
#include "qdebug.h"
+#include <private/qcore_unix_p.h> // overrides QT_OPEN
#include <syslog.h>
#include <unistd.h>
@@ -572,7 +573,7 @@ bool QTransportAuth::authorizeRequest( QTransportAuth::Data &d, const QString &r
//get cmdline from proc/pid/cmdline
snprintf( cmdlinePath, BUF_SIZE, "/proc/%d/cmdline", d.processId );
- int cmdlineFd = open( cmdlinePath, O_RDONLY );
+ int cmdlineFd = QT_OPEN( cmdlinePath, O_RDONLY );
if ( cmdlineFd == -1 )
{
qWarning( "SXE:- Error encountered in opening /proc/%u/cmdline: %s",
@@ -581,13 +582,13 @@ bool QTransportAuth::authorizeRequest( QTransportAuth::Data &d, const QString &r
}
else
{
- if ( -1 == ::read(cmdlineFd, cmdline, BUF_SIZE - 1 ) )
+ if ( -1 == QT_READ(cmdlineFd, cmdline, BUF_SIZE - 1 ) )
{
qWarning( "SXE:- Error encountered in reading /proc/%u/cmdline : %s",
d.processId, strerror(errno) );
snprintf( cmdline, BUF_SIZE, "%s", "Unknown" );
}
- close( cmdlineFd );
+ QT_CLOSE( cmdlineFd );
}
syslog( LOG_ERR | LOG_LOCAL6, "%s // PID:%u // ProgId:%u // Exe:%s // Request:%s // Cmdline:%s",