forked from qt-creator/qt-creator
create less likely to clash fifo names on windows
This commit is contained in:
@@ -39,6 +39,8 @@
|
|||||||
#include <QtNetwork/QLocalSocket>
|
#include <QtNetwork/QLocalSocket>
|
||||||
#include <QtCore/QCoreApplication>
|
#include <QtCore/QCoreApplication>
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#include <QtCore/QFile>
|
#include <QtCore/QFile>
|
||||||
@@ -80,7 +82,9 @@ bool OutputCollector::listen()
|
|||||||
return m_server->isListening();
|
return m_server->isListening();
|
||||||
m_server = new QLocalServer(this);
|
m_server = new QLocalServer(this);
|
||||||
connect(m_server, SIGNAL(newConnection()), SLOT(newConnectionAvailable()));
|
connect(m_server, SIGNAL(newConnection()), SLOT(newConnectionAvailable()));
|
||||||
return m_server->listen(QString::fromLatin1("creator-%1").arg(QCoreApplication::applicationPid())); // XXX how to make that secure?
|
return m_server->listen(QString::fromLatin1("creator-%1-%2")
|
||||||
|
.arg(QCoreApplication::applicationPid())
|
||||||
|
.arg(rand()));
|
||||||
#else
|
#else
|
||||||
if (!m_serverPath.isEmpty())
|
if (!m_serverPath.isEmpty())
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user