summaryrefslogtreecommitdiff
path: root/src/daemontools-extras/s6-notifywhenup.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2015-01-14 00:48:32 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2015-01-14 00:48:32 +0000
commitd73a8330016fbf172f8e3521b879502b9139a970 (patch)
tree9368926e55d67bf565cc0f2275e203f464cf193a /src/daemontools-extras/s6-notifywhenup.c
parenta6395bee8b2b696c0c74ff23a11944a491c83cc1 (diff)
downloads6-d73a8330016fbf172f8e3521b879502b9139a970.tar.xz
- Parallel build fixv2.0.1.0
- Complete readiness notification via supervise/ready - Version updated to 2.0.1.0, release candidate
Diffstat (limited to 'src/daemontools-extras/s6-notifywhenup.c')
-rw-r--r--src/daemontools-extras/s6-notifywhenup.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/daemontools-extras/s6-notifywhenup.c b/src/daemontools-extras/s6-notifywhenup.c
index 37f6de1..e1c02b7 100644
--- a/src/daemontools-extras/s6-notifywhenup.c
+++ b/src/daemontools-extras/s6-notifywhenup.c
@@ -11,6 +11,7 @@
#include <skalibs/iopause.h>
#include <skalibs/djbunix.h>
#include <s6/ftrigw.h>
+#include <s6/s6-supervise.h>
#define USAGE "s6-notifywhenup [ -d fd ] [ -e fifodir ] [ -f ] [ -t timeout ] prog..."
#define dieusage() strerr_dieusage(100, USAGE)
@@ -36,6 +37,10 @@ static int run_child (int fd, char const *fifodir, unsigned int timeout)
else if (r)
if (byte_chr(dummy, r, '\n') < r) break ;
}
+ close(fd) ;
+ fd = open_create(S6_SUPERVISE_READY_FILENAME) ;
+ if (fd < 0) strerr_warnwu1sys("touch " S6_SUPERVISE_READY_FILENAME) ;
+ else close(fd) ;
ftrigw_notify(fifodir, 'U') ;
return 0 ;
}