Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit e9218113 authored by Hannah von Reth's avatar Hannah von Reth

Don't try to move log file which might be in use

Summary:
While this workaround fixes the crash, the root of the problem is that every process liking that code tries to rename the file.

In the most basic case this is akonadi_control and akonadiserver.

On Windows it gets even more complicated as we might have multiple instances.

Reviewers: dvratil

Reviewed By: dvratil

Subscribers: #windows, #kde_pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D9796
parent d57561eb
......@@ -136,7 +136,7 @@ public:
file.close();
}
file.setFileName(errorLogFileName());
file.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Unbuffered);
file.open(QIODevice::WriteOnly | QIODevice::Unbuffered);
}
void setOrigHandler(QtMessageHandler origHandler_)
......@@ -205,7 +205,7 @@ void akInit(const QString &appName)
QFileInfo info(errorLogFile);
if (info.exists()) {
QFile file(info.absoluteFilePath());
const bool success = file.rename(errorLogFile + QLatin1String(".old"));
const bool success = file.copy(errorLogFile + QLatin1String(".old"));
if (!success) {
qFatal("Cannot rename log file - running on a readonly filesystem maybe?");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment