diff options
Diffstat (limited to 'nitroctl.c')
-rw-r--r-- | nitroctl.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/nitroctl.c b/nitroctl.c index 27d0780..1fa2b0b 100644 --- a/nitroctl.c +++ b/nitroctl.c @@ -60,9 +60,14 @@ notifysock(const char *service) char *path = strdup(sockpath); if (!path || !*path) path = default_sock; + path = dirname(path); snprintf(notifypath, sizeof notifypath, - "%s/notify/%s,%ld", dirname(path), service, (long)getpid()); + "%s/notify/%s,%ld", path, service, (long)getpid()); + + for (char *s = notifypath + strlen(path) + strlen("/notify/"); *s; s++) + if (*s == '/') + *s = ','; struct sockaddr_un my_addr = { 0 }; my_addr.sun_family = AF_UNIX; |