From d73a8330016fbf172f8e3521b879502b9139a970 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Wed, 14 Jan 2015 00:48:32 +0000 Subject: - Parallel build fix - Complete readiness notification via supervise/ready - Version updated to 2.0.1.0, release candidate --- src/supervision/s6-svwait.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/supervision/s6-svwait.c') diff --git a/src/supervision/s6-svwait.c b/src/supervision/s6-svwait.c index 0d7c96c..a6dc410 100644 --- a/src/supervision/s6-svwait.c +++ b/src/supervision/s6-svwait.c @@ -1,5 +1,7 @@ /* ISC license. */ +#include +#include #include #include #include @@ -77,8 +79,23 @@ int main (int argc, char const *const *argv) for (i = 0 ; i < (unsigned int)argc ; i++) { s6_svstatus_t st = S6_SVSTATUS_ZERO ; + int isup ; if (!s6_svstatus_read(argv[i], &st)) strerr_diefu1sys(111, "s6_svstatus_read") ; - bitarray_poke(states, i, !!st.pid) ; + isup = !!st.pid ; + if (re[0] == 'U' && isup) + { + unsigned int len = str_len(argv[i]) ; + char s[len + 1 + sizeof(S6_SUPERVISE_READY_FILENAME)] ; + byte_copy(s, len, argv[i]) ; + s[len] = '/' ; + byte_copy(s + len + 1, sizeof(S6_SUPERVISE_READY_FILENAME), S6_SUPERVISE_READY_FILENAME) ; + if (access(s, F_OK) < 0) + { + if (errno == ENOENT) isup = 0 ; + else strerr_warnwu2sys("check ", s) ; + } + } + bitarray_poke(states, i, isup) ; } for (;;) -- cgit v1.2.3