Diffstat (limited to 'core/launcher/transferserver.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/launcher/transferserver.cpp | 3 |
1 files changed, 3 insertions, 0 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 @@ | |||
30 | #include <qtopia/qcopenvelope_qws.h> | 30 | #include <qtopia/qcopenvelope_qws.h> |
31 | #endif | 31 | #endif |
32 | using namespace Opie::Core; | 32 | using namespace Opie::Core; |
33 | 33 | ||
34 | /* QT */ | 34 | /* QT */ |
35 | #include <qtextstream.h> | 35 | #include <qtextstream.h> |
36 | #include <qmessagebox.h> | 36 | #include <qmessagebox.h> |
37 | 37 | ||
38 | /* STD */ | 38 | /* STD */ |
39 | #include <pwd.h> | 39 | #include <pwd.h> |
40 | #include <sys/types.h> | 40 | #include <sys/types.h> |
41 | #include <unistd.h> | 41 | #include <unistd.h> |
42 | #include <fcntl.h> | ||
42 | #include <stdlib.h> | 43 | #include <stdlib.h> |
43 | #include <time.h> | 44 | #include <time.h> |
44 | 45 | ||
45 | #ifndef Q_OS_MACX | 46 | #ifndef Q_OS_MACX |
46 | #include <shadow.h> | 47 | #include <shadow.h> |
47 | #include <crypt.h> | 48 | #include <crypt.h> |
48 | #endif /* Q_OS_MACX */ | 49 | #endif /* Q_OS_MACX */ |
49 | 50 | ||
50 | const int block_size = 51200; | 51 | const int block_size = 51200; |
51 | 52 | ||
52 | TransferServer::TransferServer( Q_UINT16 port, QObject *parent, | 53 | TransferServer::TransferServer( Q_UINT16 port, QObject *parent, |
53 | const char* name) | 54 | const char* name) |
54 | : QServerSocket( port, 1, parent, name ) | 55 | : QServerSocket( port, 1, parent, name ) |
55 | { | 56 | { |
56 | connections.setAutoDelete( TRUE ); | 57 | connections.setAutoDelete( TRUE ); |
57 | if ( !ok() ) | 58 | if ( !ok() ) |
58 | owarn << "Failed to bind to port " << port << "" << oendl; | 59 | owarn << "Failed to bind to port " << port << "" << oendl; |
60 | else | ||
61 | ::fcntl( socket(), F_SETFD, FD_CLOEXEC ); | ||
59 | } | 62 | } |
60 | 63 | ||
61 | void TransferServer::authorizeConnections() | 64 | void TransferServer::authorizeConnections() |
62 | { | 65 | { |
63 | QListIterator<ServerPI> it(connections); | 66 | QListIterator<ServerPI> it(connections); |
64 | while ( it.current() ) { | 67 | while ( it.current() ) { |
65 | if ( !it.current()->verifyAuthorised() ) { | 68 | if ( !it.current()->verifyAuthorised() ) { |
66 | disconnect( it.current(), SIGNAL(connectionClosed(ServerPI*)), this, SLOT( closed(ServerPI*)) ); | 69 | disconnect( it.current(), SIGNAL(connectionClosed(ServerPI*)), this, SLOT( closed(ServerPI*)) ); |
67 | connections.removeRef( it.current() ); | 70 | connections.removeRef( it.current() ); |
68 | } else | 71 | } else |
69 | ++it; | 72 | ++it; |
70 | } | 73 | } |