fix: Coreprocess will attempt to create a daemon log before returning the path if it does not exist
This commit is contained in:
parent
cab33df72d
commit
2da14c3da3
1 changed files with 7 additions and 3 deletions
|
|
@ -530,9 +530,13 @@ QString CoreProcess::requestDaemonLogPath()
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (QFileInfo logFile(logPath); !logFile.exists() || !logFile.isFile()) {
|
if (QFileInfo logFile(logPath); !logFile.isFile()) {
|
||||||
qWarning() << "daemon log path file does not exist:" << logPath;
|
auto file = QFile(logPath);
|
||||||
return QString();
|
if (!file.open(QFile::ReadWrite)) {
|
||||||
|
qCritical() << "daemon log path file can not be written:" << logPath;
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
file.write(""); // Create an empty file
|
||||||
}
|
}
|
||||||
|
|
||||||
return logPath;
|
return logPath;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue