summaryrefslogtreecommitdiff
path: root/src/libs6/s6_supervise_link.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2020-12-09 18:27:43 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2020-12-09 18:27:43 +0000
commitdd4afee4a8ea8c44126c44b31c6f1a36582d0964 (patch)
tree9ca57ff17554b33edc6a86be5e736bdc833f4158 /src/libs6/s6_supervise_link.c
parentfddebb529fb620a9e038340fc554ec2e543802be (diff)
downloads6-dd4afee4a8ea8c44126c44b31c6f1a36582d0964.tar.xz
Get rid of webipc.h
Diffstat (limited to 'src/libs6/s6_supervise_link.c')
-rw-r--r--src/libs6/s6_supervise_link.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libs6/s6_supervise_link.c b/src/libs6/s6_supervise_link.c
index 118d66c..4258e18 100644
--- a/src/libs6/s6_supervise_link.c
+++ b/src/libs6/s6_supervise_link.c
@@ -68,9 +68,9 @@ int s6_supervise_link (char const *scdir, char const *const *servicedirs, size_t
}
{
+ stralloc lnames = STRALLOC_ZERO ;
ftrigr_t a = FTRIGR_ZERO ;
stralloc rpsa = STRALLOC_ZERO ;
- stralloc lnames = STRALLOC_ZERO ;
gid_t gid = options & 2 ? -1 : getegid() ;
size_t scdirlen = strlen(scdir) ;
size_t prefixlen = strlen(prefix) ;
@@ -91,13 +91,14 @@ int s6_supervise_link (char const *scdir, char const *const *servicedirs, size_t
char *p ;
size_t len = strlen(servicedirs[i]) ;
memcpy(fn, servicedirs[i], len) ;
- memcpy(fn + len, S6_SUPERVISE_EVENTDIR, sizeof(S6_SUPERVISE_EVENTDIR)) ;
+ fn[len] = '/' ;
+ memcpy(fn + len + 1, S6_SUPERVISE_EVENTDIR, sizeof(S6_SUPERVISE_EVENTDIR)) ;
if (!ftrigw_fifodir_make(fn, gid, options & 1)) goto err ;
ids[m] = ftrigr_subscribe(&a, fn, "s", 0, deadline, stamp) ;
if (!ids[m++]) goto err ;
if (bitarray_peek(logged, i))
{
- memcpy(fn + len, "/log/", 5) ;
+ memcpy(fn + len + 1, "log/", 4) ;
memcpy(fn + len + 5, S6_SUPERVISE_EVENTDIR, sizeof(S6_SUPERVISE_EVENTDIR)) ;
if (!ftrigw_fifodir_make(fn, gid, options & 1)) goto err ;
ids[m] = ftrigr_subscribe(&a, fn, "s", 0, deadline, stamp) ;