summaryrefslogtreecommitdiff
path: root/src/libs6rc/s6rc_servicedir_unsupervise.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-03-13 13:08:49 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-03-13 13:08:49 +0000
commit2270be82ade6f2e63d652602a3842aa1fca3cb7c (patch)
treed159fd148ffec62a2e8c6d79beb3e50e0514571a /src/libs6rc/s6rc_servicedir_unsupervise.c
parent1e709ae40466a7742ba8cbdeff841c6edfaa5e5e (diff)
downloads6-rc-2270be82ade6f2e63d652602a3842aa1fca3cb7c.tar.xz
Adapt to skalibs-2.5.0.0
Diffstat (limited to 'src/libs6rc/s6rc_servicedir_unsupervise.c')
-rw-r--r--src/libs6rc/s6rc_servicedir_unsupervise.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/libs6rc/s6rc_servicedir_unsupervise.c b/src/libs6rc/s6rc_servicedir_unsupervise.c
index bc5ab63..8b0dbb9 100644
--- a/src/libs6rc/s6rc_servicedir_unsupervise.c
+++ b/src/libs6rc/s6rc_servicedir_unsupervise.c
@@ -1,24 +1,23 @@
/* ISC license. */
-#include <sys/types.h>
+#include <string.h>
#include <unistd.h>
-#include <skalibs/bytestr.h>
#include <s6/s6-supervise.h>
#include <s6-rc/s6rc-servicedir.h>
void s6rc_servicedir_unsupervise (char const *live, char const *name, int keepsupervisor)
{
- size_t namelen = str_len(name) ;
- size_t livelen = str_len(live) ;
+ size_t namelen = strlen(name) ;
+ size_t livelen = strlen(live) ;
char fn[livelen + 14 + namelen] ;
- byte_copy(fn, livelen, live) ;
- byte_copy(fn + livelen, 9, "/scandir/") ;
- byte_copy(fn + livelen + 9, namelen + 1, name) ;
+ memcpy(fn, live, livelen) ;
+ memcpy(fn + livelen, "/scandir/", 9) ;
+ memcpy(fn + livelen + 9, name, namelen + 1) ;
unlink(fn) ;
if (!keepsupervisor)
{
- byte_copy(fn + livelen + 1, 12, "servicedirs/") ;
- byte_copy(fn + livelen + 13, namelen + 1, name) ;
+ memcpy(fn + livelen + 1, "servicedirs/", 12) ;
+ memcpy(fn + livelen + 13, name, namelen + 1) ;
s6_svc_writectl(fn, S6_SUPERVISE_CTLDIR, "x", 1) ;
}
}