summaryrefslogtreecommitdiff
path: root/src/libs6rc/s6rc_servicedir_block.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_block.c
parent1e709ae40466a7742ba8cbdeff841c6edfaa5e5e (diff)
downloads6-rc-2270be82ade6f2e63d652602a3842aa1fca3cb7c.tar.xz
Adapt to skalibs-2.5.0.0
Diffstat (limited to 'src/libs6rc/s6rc_servicedir_block.c')
-rw-r--r--src/libs6rc/s6rc_servicedir_block.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/libs6rc/s6rc_servicedir_block.c b/src/libs6rc/s6rc_servicedir_block.c
index 9fb28b1..a7e2b12 100644
--- a/src/libs6rc/s6rc_servicedir_block.c
+++ b/src/libs6rc/s6rc_servicedir_block.c
@@ -1,25 +1,24 @@
/* ISC license. */
-#include <sys/types.h>
+#include <string.h>
#include <errno.h>
#include <unistd.h>
-#include <skalibs/bytestr.h>
#include <skalibs/djbunix.h>
#include <s6/s6-supervise.h>
#include <s6-rc/s6rc-servicedir.h>
int s6rc_servicedir_block (char const *dir)
{
- size_t dirlen = str_len(dir) ;
+ size_t dirlen = strlen(dir) ;
s6_svstatus_t status ;
char fn[dirlen + 6] ;
if (!s6_svstatus_read(dir, &status)) return -1 ;
- byte_copy(fn, dirlen, dir) ;
- byte_copy(fn + dirlen, 6, "/down") ;
+ memcpy(fn, dir, dirlen) ;
+ memcpy(fn + dirlen, "/down", 6) ;
if (!touch(fn)) return -1 ;
if (s6_svc_writectl(dir, S6_SUPERVISE_CTLDIR, "O", 1) < 0)
{
- register int e = errno ;
+ int e = errno ;
unlink(fn) ;
errno = e ;
return -1 ;