summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/qcopbridge.cpp2
-rw-r--r--core/launcher/transferserver.cpp3
2 files changed, 5 insertions, 0 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
@@ -44,8 +44,9 @@ using namespace Opie::Core;
#endif
#ifndef Q_OS_WIN32
#include <pwd.h>
#include <unistd.h>
+#include <fcntl.h>
#include <sys/types.h>
#endif
#if defined(_OS_LINUX_)
@@ -62,8 +63,9 @@ QCopBridge::QCopBridge( Q_UINT16 port, QObject *parent,
{
if ( !ok() )
owarn << "Failed to bind to port " << port << "" << oendl;
else {
+ ::fcntl( socket(), F_SETFD, FD_CLOEXEC );
#ifndef QT_NO_COP
desktopChannel = new QCopChannel( "QPE/Desktop", this );
connect( desktopChannel, SIGNAL(received(const QCString&,const QByteArray&)),
this, SLOT(desktopMessage(const QCString&,const QByteArray&)) );
diff --git a/core/launcher/transferserver.cpp b/core/launcher/transferserver.cpp
index 2b2e435..a219c0f 100644
--- a/core/launcher/transferserver.cpp
+++ b/core/launcher/transferserver.cpp
@@ -38,8 +38,9 @@ using namespace Opie::Core;
/* STD */
#include <pwd.h>
#include <sys/types.h>
#include <unistd.h>
+#include <fcntl.h>
#include <stdlib.h>
#include <time.h>
#ifndef Q_OS_MACX
@@ -55,8 +56,10 @@ TransferServer::TransferServer( Q_UINT16 port, QObject *parent,
{
connections.setAutoDelete( TRUE );
if ( !ok() )
owarn << "Failed to bind to port " << port << "" << oendl;
+ else
+ ::fcntl( socket(), F_SETFD, FD_CLOEXEC );
}
void TransferServer::authorizeConnections()
{