summaryrefslogtreecommitdiff
path: root/core/launcher/qcopbridge.cpp
Unidiff
Diffstat (limited to 'core/launcher/qcopbridge.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/qcopbridge.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/launcher/qcopbridge.cpp b/core/launcher/qcopbridge.cpp
index e339dc7..64eb096 100644
--- a/core/launcher/qcopbridge.cpp
+++ b/core/launcher/qcopbridge.cpp
@@ -36,42 +36,44 @@ using namespace Opie::Core;
36#include <qtimer.h> 36#include <qtimer.h>
37#ifdef Q_WS_QWS 37#ifdef Q_WS_QWS
38#include <qcopchannel_qws.h> 38#include <qcopchannel_qws.h>
39#endif 39#endif
40 40
41/* STD */ 41/* STD */
42#ifndef _XOPEN_SOURCE 42#ifndef _XOPEN_SOURCE
43#define _XOPEN_SOURCE 43#define _XOPEN_SOURCE
44#endif 44#endif
45#ifndef Q_OS_WIN32 45#ifndef Q_OS_WIN32
46#include <pwd.h> 46#include <pwd.h>
47#include <unistd.h> 47#include <unistd.h>
48#include <fcntl.h>
48#include <sys/types.h> 49#include <sys/types.h>
49#endif 50#endif
50 51
51#if defined(_OS_LINUX_) 52#if defined(_OS_LINUX_)
52#include <shadow.h> 53#include <shadow.h>
53#endif 54#endif
54 55
55const int block_size = 51200; 56const int block_size = 51200;
56 57
57QCopBridge::QCopBridge( Q_UINT16 port, QObject *parent, 58QCopBridge::QCopBridge( Q_UINT16 port, QObject *parent,
58 const char* name ) 59 const char* name )
59 : QServerSocket( port, 1, parent, name ), 60 : QServerSocket( port, 1, parent, name ),
60 desktopChannel( 0 ), 61 desktopChannel( 0 ),
61 cardChannel( 0 ) 62 cardChannel( 0 )
62{ 63{
63 if ( !ok() ) 64 if ( !ok() )
64 owarn << "Failed to bind to port " << port << "" << oendl; 65 owarn << "Failed to bind to port " << port << "" << oendl;
65 else { 66 else {
67 ::fcntl( socket(), F_SETFD, FD_CLOEXEC );
66#ifndef QT_NO_COP 68#ifndef QT_NO_COP
67 desktopChannel = new QCopChannel( "QPE/Desktop", this ); 69 desktopChannel = new QCopChannel( "QPE/Desktop", this );
68 connect( desktopChannel, SIGNAL(received(const QCString&,const QByteArray&)), 70 connect( desktopChannel, SIGNAL(received(const QCString&,const QByteArray&)),
69 this, SLOT(desktopMessage(const QCString&,const QByteArray&)) ); 71 this, SLOT(desktopMessage(const QCString&,const QByteArray&)) );
70 cardChannel = new QCopChannel( "QPE/Card", this ); 72 cardChannel = new QCopChannel( "QPE/Card", this );
71 connect( cardChannel, SIGNAL(received(const QCString&,const QByteArray&)), 73 connect( cardChannel, SIGNAL(received(const QCString&,const QByteArray&)),
72 this, SLOT(desktopMessage(const QCString&,const QByteArray&)) ); 74 this, SLOT(desktopMessage(const QCString&,const QByteArray&)) );
73#endif 75#endif
74 } 76 }
75 sendSync = FALSE; 77 sendSync = FALSE;
76 openConnections.setAutoDelete( TRUE ); 78 openConnections.setAutoDelete( TRUE );
77 authorizeConnections(); 79 authorizeConnections();