summaryrefslogtreecommitdiff
path: root/src/libs6rc/s6rc_servicedir_block.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs6rc/s6rc_servicedir_block.c')
-rw-r--r--src/libs6rc/s6rc_servicedir_block.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/libs6rc/s6rc_servicedir_block.c b/src/libs6rc/s6rc_servicedir_block.c
index bc85f07..4516148 100644
--- a/src/libs6rc/s6rc_servicedir_block.c
+++ b/src/libs6rc/s6rc_servicedir_block.c
@@ -1,28 +1,13 @@
/* ISC license. */
-#include <string.h>
-#include <unistd.h>
-
-#include <skalibs/posixplz.h>
-#include <skalibs/djbunix.h>
-
#include <s6/supervise.h>
#include <s6-rc/s6rc-servicedir.h>
int s6rc_servicedir_block (char const *dir)
{
- size_t dirlen = strlen(dir) ;
s6_svstatus_t status ;
- char fn[dirlen + 6] ;
if (!s6_svstatus_read(dir, &status)) return -1 ;
- 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)
- {
- unlink_void(fn) ;
- return -1 ;
- }
+ if (s6_svc_writectl(dir, S6_SUPERVISE_CTLDIR, "Q", 1) < 0) return -1 ;
return status.flagwantup ;
}