diff options
| author | SulfurNitride <SulfurNitride@users.noreply.github.com> | 2026-04-06 20:29:09 -0500 |
|---|---|---|
| committer | SulfurNitride <SulfurNitride@users.noreply.github.com> | 2026-04-06 20:29:09 -0500 |
| commit | e29d056a16fe0233d610c7a57eb141c3fd1dbba8 (patch) | |
| tree | edd6adc53359ca6a8b9f136f8b91c6431983f3b7 | |
| parent | 0589fbf8171901812f4e9df14d4572e9d578be98 (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>
| -rw-r--r-- | src/src/nxmhandler_linux.cpp | 7 |
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); |
