Valgrind: Fix IP port detection

Listen on either IPv4 or IPv6 localhost but not both.

Change-Id: I0fcec59fa1c21346582343ad30a9448e3ee9440f
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Aurindam Jana
2013-04-24 11:19:39 +02:00
committed by Kai Koehne
parent 253a8522bb
commit fc194f82e1

View File

@@ -78,8 +78,10 @@ Analyzer::AnalyzerStartParameters ValgrindTool::createStartParameters(
ProjectExplorer::DeviceKitInformation::device(runConfiguration->target()->kit());
QTC_ASSERT(device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE, return sp);
QTcpServer server;
if (!server.listen(QHostAddress::LocalHost) || !server.listen(QHostAddress::LocalHostIPv6))
if (!server.listen(QHostAddress::LocalHost) && !server.listen(QHostAddress::LocalHostIPv6)) {
qWarning() << "Cannot open port on host for profiling.";
return sp;
}
sp.connParams.host = server.serverAddress().toString();
sp.connParams.port = server.serverPort();
sp.startMode = Analyzer::StartLocal;