aboutsummaryrefslogtreecommitdiff
path: root/src/ipc_common.c
blob: 994397582769c86562aa63c3ebdc1e95f7bce145 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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);
}