backport fix for #77412

svn path=/branches/KDE_3_2_BRANCH/kdenetwork/krfb/; revision=300241
This commit is contained in:
Tim Jansen
2004-03-31 21:52:45 +00:00
parent ff143ee6b2
commit 3df37f41e6

View File

@@ -32,6 +32,9 @@
#include <klocale.h>
#include <kglobal.h>
#include <unistd.h>
#include <fcntl.h>
PortListener::PortListener(KService::Ptr s,
KConfig *config,
KServiceRegistry *srvreg) :
@@ -188,6 +191,9 @@ void PortListener::accepted(KSocket *sock) {
return;
}
// disable CLOEXEC flag, fixes #77412
fcntl(sock->socket(), F_SETFD, fcntl(sock->socket(), F_GETFD) & ~FD_CLOEXEC);
m_process.clearArguments();
m_process << m_execPath << m_argument << QString::number(sock->socket());
if (!m_process.start(KProcess::DontCare)) {