aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSulfurNitride <SulfurNitride@users.noreply.github.com>2026-04-06 20:29:09 -0500
committerSulfurNitride <SulfurNitride@users.noreply.github.com>2026-04-06 20:29:09 -0500
commite29d056a16fe0233d610c7a57eb141c3fd1dbba8 (patch)
treeedd6adc53359ca6a8b9f136f8b91c6431983f3b7 /src
parent0589fbf8171901812f4e9df14d4572e9d578be98 (diff)
Create parent directory for NXM socket if it doesn't exist
XDG_RUNTIME_DIR may point to a non-existent path on some configurations, causing QLocalServer::listen to fail with "Name error". Ensure the parent directory exists before attempting to create the socket. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'src')
-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);