aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/src/nxmhandler_linux.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/src/nxmhandler_linux.cpp b/src/src/nxmhandler_linux.cpp
index 9441375..5d4f8ab 100644
--- a/src/src/nxmhandler_linux.cpp
+++ b/src/src/nxmhandler_linux.cpp
@@ -266,6 +266,13 @@ bool NxmHandlerLinux::startListener()
const QString path = socketPath();
+ // Ensure parent directory exists (XDG_RUNTIME_DIR may point to a
+ // non-existent path on some configurations).
+ const QDir parentDir = QFileInfo(path).dir();
+ if (!parentDir.exists()) {
+ QDir().mkpath(parentDir.absolutePath());
+ }
+
QLocalServer::removeServer(path);
if (QFileInfo::exists(path)) {
QFile::remove(path);