summaryrefslogtreecommitdiff
path: root/core/launcher/transferserver.cpp
Side-by-side diff
Diffstat (limited to 'core/launcher/transferserver.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/transferserver.cpp5
1 files changed, 4 insertions, 1 deletions
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
@@ -30,41 +30,44 @@
#include <qtopia/qcopenvelope_qws.h>
#endif
using namespace Opie::Core;
/* QT */
#include <qtextstream.h>
#include <qmessagebox.h>
/* STD */
#include <pwd.h>
#include <sys/types.h>
#include <unistd.h>
+#include <fcntl.h>
#include <stdlib.h>
#include <time.h>
#ifndef Q_OS_MACX
#include <shadow.h>
#include <crypt.h>
#endif /* Q_OS_MACX */
const int block_size = 51200;
TransferServer::TransferServer( Q_UINT16 port, QObject *parent,
const char* name)
: QServerSocket( port, 1, parent, name )
{
connections.setAutoDelete( TRUE );
if ( !ok() )
- owarn << "Failed to bind to port " << port << "" << oendl;
+ owarn << "Failed to bind to port " << port << "" << oendl;
+ else
+ ::fcntl( socket(), F_SETFD, FD_CLOEXEC );
}
void TransferServer::authorizeConnections()
{
QListIterator<ServerPI> it(connections);
while ( it.current() ) {
if ( !it.current()->verifyAuthorised() ) {
disconnect( it.current(), SIGNAL(connectionClosed(ServerPI*)), this, SLOT( closed(ServerPI*)) );
connections.removeRef( it.current() );
} else
++it;
}