diff options
author | Kai Koehne <kai.koehne@theqtcompany.com> | 2015-01-29 17:22:38 +0100 |
---|---|---|
committer | Kai Koehne <kai.koehne@theqtcompany.com> | 2015-02-02 14:29:29 +0000 |
commit | a40ed1fb156a89b7bad3b886dc66ffc7adf2219f (patch) | |
tree | 14626921d91df16f800a1deced487853e484c622 /src/libs/installer/remoteserver.cpp | |
parent | 8d40794f8b4e1f2ea944659673bac79d221f5c17 (diff) |
RemoteServer: Make sure we don't write to stderr
In adminauthorization_x11.cpp we redirect stderr of the child
process to a pipe, but do not read from it anymore after sudo
completed. Which means, if the server process continues to write
into the pipe it'll block at some point.
Avoid this by always closing the stderr handle in production mode.
Change-Id: If1e9578f12d7a0f60811f9c2b43cd9c18adfea59
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
Diffstat (limited to 'src/libs/installer/remoteserver.cpp')
-rw-r--r-- | src/libs/installer/remoteserver.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libs/installer/remoteserver.cpp b/src/libs/installer/remoteserver.cpp index eeab37c6e..185466ccd 100644 --- a/src/libs/installer/remoteserver.cpp +++ b/src/libs/installer/remoteserver.cpp @@ -71,6 +71,14 @@ void RemoteServer::start() if (d->m_tcpServer) return; +#if defined(Q_OS_UNIX) && !defined(Q_OS_OSX) + // avoid writing to stderr: + // the parent process has redirected stderr to a pipe to work with sudo, + // but is not reading anymore -> writing to stderr will block after a while. + if (d->m_mode == Protocol::Mode::Production) + fclose(stderr); +#endif + d->m_tcpServer = new TcpServer(d->m_port, d->m_key); d->m_tcpServer->moveToThread(&d->m_thread); connect(&d->m_thread, SIGNAL(finished()), d->m_tcpServer, SLOT(deleteLater())); |