aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/msgpack_rpc/server.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2022-06-30 13:16:46 +0200
committerGitHub <noreply@github.com>2022-06-30 04:16:46 -0700
commitf50135a32e11c535e1dc3a8e9460c5b4e640ee86 (patch)
tree4531a75f5f099877cb8d672743abf03004171f4f /src/nvim/msgpack_rpc/server.c
parent514e76e4b2903530922529c60bfbf32cadd257a3 (diff)
downloadrneovim-f50135a32e11c535e1dc3a8e9460c5b4e640ee86.tar.gz
rneovim-f50135a32e11c535e1dc3a8e9460c5b4e640ee86.tar.bz2
rneovim-f50135a32e11c535e1dc3a8e9460c5b4e640ee86.zip
feat: stdpath('run'), /tmp/nvim.user/ #18993
Problem: - Since c57f6b28d71d #8519, sockets are created in ~/.local/… but XDG spec says: "XDG_RUNTIME_DIR: Must be on the local filesystem", which implies that XDG_STATE_DIR is potentially non-local. - Not easy to inspect Nvim-created temp files (for debugging etc). Solution: - Store sockets in stdpath('run') ($XDG_RUNTIME_DIR). - Establish "/tmp/nvim.user/" as the tempdir root shared by all Nvims. - Make ok() actually useful. - Introduce assert_nolog(). closes #3517 closes #17093
Diffstat (limited to 'src/nvim/msgpack_rpc/server.c')
-rw-r--r--src/nvim/msgpack_rpc/server.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/msgpack_rpc/server.c b/src/nvim/msgpack_rpc/server.c
index c9e707aa92..b252f0998e 100644
--- a/src/nvim/msgpack_rpc/server.c
+++ b/src/nvim/msgpack_rpc/server.c
@@ -89,7 +89,7 @@ void server_teardown(void)
///
/// Named pipe format:
/// - Windows: "\\.\pipe\<name>.<pid>.<counter>"
-/// - Other: "~/.local/state/nvim/<name>.<pid>.<counter>"
+/// - Other: "/tmp/nvim.user/xxx/<name>.<pid>.<counter>"
char *server_address_new(const char *name)
{
static uint32_t count = 0;
@@ -98,7 +98,7 @@ char *server_address_new(const char *name)
int r = snprintf(fmt, sizeof(fmt), "\\\\.\\pipe\\%s.%" PRIu64 ".%" PRIu32,
name ? name : "nvim", os_get_pid(), count++);
#else
- char *dir = get_xdg_home(kXDGStateHome);
+ char *dir = stdpaths_get_xdg_var(kXDGRuntimeDir);
int r = snprintf(fmt, sizeof(fmt), "%s/%s.%" PRIu64 ".%" PRIu32,
dir, name ? name : "nvim", os_get_pid(), count++);
xfree(dir);