mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-22 22:34:15 +02:00
remove getpid usage and replace with Qt solution
This commit is contained in:
parent
c8aeab53ba
commit
3f44203984
1 changed files with 2 additions and 16 deletions
|
@ -12,15 +12,7 @@
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#ifdef _WIN32
|
#include <qcoreapplication.h>
|
||||||
#include <process.h>
|
|
||||||
#define getpid _getpid
|
|
||||||
#define getppid _getpid // hack to build
|
|
||||||
#define pid_t int // hack to build
|
|
||||||
#elif __linux__
|
|
||||||
#include <unistd.h> // for getpid() on linux
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <qdebug.h>
|
#include <qdebug.h>
|
||||||
#include <qtimer.h>
|
#include <qtimer.h>
|
||||||
|
|
||||||
|
@ -122,14 +114,8 @@ QString LogHandler::printMessage(LogMsgType type, const QMessageLogContext& cont
|
||||||
prefixString.append(QString(" [%1]").arg(dateString));
|
prefixString.append(QString(" [%1]").arg(dateString));
|
||||||
|
|
||||||
if (_shouldOutputPID) {
|
if (_shouldOutputPID) {
|
||||||
prefixString.append(QString(" [%1").arg(getpid()));
|
prefixString.append(QString(" [%1]").arg(QCoreApplication::instance()->applicationPid()));
|
||||||
|
|
||||||
pid_t parentProcessID = getppid();
|
|
||||||
if (parentProcessID != 0) {
|
|
||||||
prefixString.append(QString(":%1]").arg(parentProcessID));
|
|
||||||
} else {
|
|
||||||
prefixString.append("]");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_targetName.isEmpty()) {
|
if (!_targetName.isEmpty()) {
|
||||||
|
|
Loading…
Reference in a new issue