summaryrefslogtreecommitdiff
path: root/src/libs6/s6_supervise_unlink.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2020-12-10 18:29:11 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2020-12-10 18:29:11 +0000
commitbba745f906d2a29ec0f619f61c746ad8cbdf5621 (patch)
tree53285edad74a27081d84a6e5a6b67aa259da8292 /src/libs6/s6_supervise_unlink.c
parenta78d49b8eecbbd9f0a6dbef688ac4a4a0e88fe8d (diff)
downloads6-bba745f906d2a29ec0f619f61c746ad8cbdf5621.tar.xz
Add the possibility of down files to s6_supervise_link
Diffstat (limited to 'src/libs6/s6_supervise_unlink.c')
-rw-r--r--src/libs6/s6_supervise_unlink.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libs6/s6_supervise_unlink.c b/src/libs6/s6_supervise_unlink.c
index 36d765b..2e5a9ec 100644
--- a/src/libs6/s6_supervise_unlink.c
+++ b/src/libs6/s6_supervise_unlink.c
@@ -27,10 +27,14 @@ void s6_supervise_unlink (char const *scdir, char const *name, uint32_t options)
memcpy(fn, scdir, scdirlen) ;
fn[scdirlen] = '/' ;
memcpy(fn + scdirlen + 1, name, namelen) ;
+ if (options & 4)
+ {
+ memcpy(fn + scdirlen + 1 + namelen, "/down", 6) ;
+ unlink_void(fn) ;
+ }
if (options & 1)
{
- fn[scdirlen + 1 + namelen] = '/' ;
- memcpy(fn + scdirlen + 1 + namelen + 1, S6_SUPERVISE_CTLDIR, sizeof(S6_SUPERVISE_CTLDIR) - 1) ;
+ memcpy(fn + scdirlen + 1 + namelen, "/" S6_SUPERVISE_CTLDIR, sizeof(S6_SUPERVISE_CTLDIR)) ;
memcpy(fn + scdirlen + 1 + namelen + sizeof(S6_SUPERVISE_CTLDIR), "/control", 9) ;
fd = open_write(fn) ;
}