summaryrefslogtreecommitdiff
path: root/src/supervision/s6-svwait.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2015-01-16 01:36:48 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2015-01-16 01:36:48 +0000
commit83853a80eb18238796154164f9ea776b0c167ab7 (patch)
treea8087bab87fb1cf09a63f3b0619389a2ce3b2e37 /src/supervision/s6-svwait.c
parent87c5b2118efcee65eeda3f743d081ea9c2b866d9 (diff)
downloads6-83853a80eb18238796154164f9ea776b0c167ab7.tar.xz
- s6-svlisten and s6-svlisten1
- Synchronous s6-svc - version 2.0.2.0, rc
Diffstat (limited to 'src/supervision/s6-svwait.c')
-rw-r--r--src/supervision/s6-svwait.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/supervision/s6-svwait.c b/src/supervision/s6-svwait.c
index a6dc410..9e8520b 100644
--- a/src/supervision/s6-svwait.c
+++ b/src/supervision/s6-svwait.c
@@ -13,7 +13,7 @@
#include <s6/ftrigr.h>
#include <s6/s6-supervise.h>
-#define USAGE "s6-svwait [ -U | -u | -d ] [ -A | -a | -o ] [ -t timeout ] servicedir..."
+#define USAGE "s6-svwait [ -U | -u | -d ] [ -a | -o ] [ -t timeout ] servicedir..."
#define dieusage() strerr_dieusage(100, USAGE)
static inline int check (unsigned char const *ba, unsigned int n, int wantup, int or)
@@ -25,7 +25,6 @@ int main (int argc, char const *const *argv)
{
tain_t deadline, tto ;
ftrigr_t a = FTRIGR_ZERO ;
- uint32 options = FTRIGR_REPEAT ;
int or = 0 ;
int wantup = 1 ;
char re[4] = "u|d" ;
@@ -35,16 +34,15 @@ int main (int argc, char const *const *argv)
unsigned int t = 0 ;
for (;;)
{
- register int opt = subgetopt_r(argc, argv, "uUdAaot:", &l) ;
+ register int opt = subgetopt_r(argc, argv, "uUdaot:", &l) ;
if (opt == -1) break ;
switch (opt)
{
case 'U' : wantup = 1 ; re[0] = 'U' ; break ;
case 'u' : wantup = 1 ; re[0] = 'u' ; break ;
case 'd' : wantup = 0 ; break ;
- case 'A' : or = 0 ; options |= FTRIGR_REPEAT ; break ;
- case 'a' : or = 0 ; options &= ~FTRIGR_REPEAT ; break ;
- case 'o' : or = 1 ; options &= ~FTRIGR_REPEAT ; break ;
+ case 'a' : or = 0 ; break ;
+ case 'o' : or = 1 ; break ;
case 't' : if (!uint0_scan(l.arg, &t)) dieusage() ; break ;
default : dieusage() ;
}
@@ -72,8 +70,8 @@ int main (int argc, char const *const *argv)
byte_copy(s, len, argv[i]) ;
s[len] = '/' ;
byte_copy(s + len + 1, sizeof(S6_SUPERVISE_EVENTDIR), S6_SUPERVISE_EVENTDIR) ;
- list[i] = ftrigr_subscribe_g(&a, s, re, options, &deadline) ;
- if (!list[i]) strerr_diefu2sys(111, "ftrigr_subscribe to ", argv[i]) ;
+ list[i] = ftrigr_subscribe_g(&a, s, re, FTRIGR_REPEAT, &deadline) ;
+ if (!list[i]) strerr_diefu2sys(111, "subscribe to events for", argv[i]) ;
}
for (i = 0 ; i < (unsigned int)argc ; i++)