diff options
Diffstat (limited to 'src/ipc_common.c')
-rw-r--r-- | src/ipc_common.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ipc_common.c b/src/ipc_common.c new file mode 100644 index 0000000..9943975 --- /dev/null +++ b/src/ipc_common.c @@ -0,0 +1,14 @@ +#include "ipc.h" + +#include <stdio.h> +#include <stdlib.h> + +void imv_ipc_path(char *buf, size_t len, int pid) +{ + const char *base = getenv("XDG_RUNTIME_DIR"); + if (!base) { + base = "/tmp"; + } + snprintf(buf, len, "%s/imv-%d.sock", base, pid); +} + |