summaryrefslogtreecommitdiff
path: root/src/libs6rc/s6rc_servicedir_unsupervise.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-10-08 15:39:57 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-10-08 15:39:57 +0000
commitf9940bb7d1a6ce7d7772e8cbdbbd55a321cc5c18 (patch)
tree352798ff6073e18a467a9ffeab548485070dc568 /src/libs6rc/s6rc_servicedir_unsupervise.c
parent8c341bbaca5e89a9620702bc0025641e815e4195 (diff)
downloads6-rc-f9940bb7d1a6ce7d7772e8cbdbbd55a321cc5c18.tar.xz
Add -s to s6-rc-init; prepare for 0.3.0.0
Diffstat (limited to 'src/libs6rc/s6rc_servicedir_unsupervise.c')
-rw-r--r--src/libs6rc/s6rc_servicedir_unsupervise.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libs6rc/s6rc_servicedir_unsupervise.c b/src/libs6rc/s6rc_servicedir_unsupervise.c
index 8b0dbb9..ed95152 100644
--- a/src/libs6rc/s6rc_servicedir_unsupervise.c
+++ b/src/libs6rc/s6rc_servicedir_unsupervise.c
@@ -5,14 +5,16 @@
#include <s6/s6-supervise.h>
#include <s6-rc/s6rc-servicedir.h>
-void s6rc_servicedir_unsupervise (char const *live, char const *name, int keepsupervisor)
+void s6rc_servicedir_unsupervise (char const *live, char const *suffix, char const *name, int keepsupervisor)
{
- size_t namelen = strlen(name) ;
size_t livelen = strlen(live) ;
- char fn[livelen + 14 + namelen] ;
+ size_t suffixlen = strlen(suffix) ;
+ size_t namelen = strlen(name) ;
+ char fn[livelen + 14 + namelen + suffixlen] ;
memcpy(fn, live, livelen) ;
memcpy(fn + livelen, "/scandir/", 9) ;
- memcpy(fn + livelen + 9, name, namelen + 1) ;
+ memcpy(fn + livelen + 9, name, namelen) ;
+ memcpy(fn + livelen + 9 + namelen, suffix, suffixlen + 1) ;
unlink(fn) ;
if (!keepsupervisor)
{