summaryrefslogtreecommitdiff
path: root/src/supervision
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-07-12 18:22:55 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-07-12 18:22:55 +0000
commitf7c2e436ed0144d09cff0e3ac90f510a47f0aeac (patch)
tree2306f029b468623ed316ac3df40a4df8d13c5c5e /src/supervision
parentf80dbef73f98ae1a801078e5f69a071651e6b52d (diff)
downloads6-f7c2e436ed0144d09cff0e3ac90f510a47f0aeac.tar.xz
Add s6_svc_lock_take() and s6_svc_lock_release()
Allows fixing a race condition in s6-rc-init. s6-supervise also creates event/ before supervise/ so that locking the servicedir ensures event/ can be used.
Diffstat (limited to 'src/supervision')
-rw-r--r--src/supervision/s6-supervise.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/supervision/s6-supervise.c b/src/supervision/s6-supervise.c
index 7527668..71f247e 100644
--- a/src/supervision/s6-supervise.c
+++ b/src/supervision/s6-supervise.c
@@ -599,9 +599,9 @@ int main (int argc, char const *const *argv)
memcpy(progname + proglen + 1, argv[1], namelen + 1) ;
PROG = progname ;
if (!fd_sanitize()) strerr_diefu1sys(111, "sanitize stdin and stdout") ;
- x[1].fd = s6_supervise_lock(S6_SUPERVISE_CTLDIR) ;
if (!ftrigw_fifodir_make(S6_SUPERVISE_EVENTDIR, getegid(), 0))
strerr_diefu2sys(111, "mkfifodir ", S6_SUPERVISE_EVENTDIR) ;
+ x[1].fd = s6_supervise_lock(S6_SUPERVISE_CTLDIR) ;
x[0].fd = selfpipe_init() ;
if (x[0].fd == -1) strerr_diefu1sys(111, "init selfpipe") ;
if (sig_ignore(SIGPIPE) < 0) strerr_diefu1sys(111, "ignore SIGPIPE") ;