summaryrefslogtreecommitdiff
path: root/src/libs6rc/s6rc_servicedir_block.c
blob: 4516148abcd59918faa0e309f6436b00c43576f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* ISC license. */

#include <s6/supervise.h>

#include <s6-rc/s6rc-servicedir.h>

int s6rc_servicedir_block (char const *dir)
{
  s6_svstatus_t status ;
  if (!s6_svstatus_read(dir, &status)) return -1 ;
  if (s6_svc_writectl(dir, S6_SUPERVISE_CTLDIR, "Q", 1) < 0) return -1 ;
  return status.flagwantup ;
}