diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2021-08-09 23:42:35 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2021-08-09 23:42:35 +0000 |
commit | aaea6322e9e765969f452764e51ca1ddd9783264 (patch) | |
tree | 4e863537677e0266a79c4045c47a5e6b9f64a1a8 /src/pipe-tools | |
parent | ce2977ee9195612730bc8713f142c95f79605e75 (diff) | |
download | s6-aaea6322e9e765969f452764e51ca1ddd9783264.tar.gz s6-aaea6322e9e765969f452764e51ca1ddd9783264.tar.xz s6-aaea6322e9e765969f452764e51ca1ddd9783264.zip |
skalibs-2.11.0.0 API change
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/pipe-tools')
-rw-r--r-- | src/pipe-tools/s6-ftrig-listen.c | 10 | ||||
-rw-r--r-- | src/pipe-tools/s6-ftrig-listen1.c | 10 | ||||
-rw-r--r-- | src/pipe-tools/s6-ftrig-wait.c | 4 | ||||
-rw-r--r-- | src/pipe-tools/s6-mkfifodir.c | 2 |
4 files changed, 11 insertions, 15 deletions
diff --git a/src/pipe-tools/s6-ftrig-listen.c b/src/pipe-tools/s6-ftrig-listen.c index c6c105f..bd4a280 100644 --- a/src/pipe-tools/s6-ftrig-listen.c +++ b/src/pipe-tools/s6-ftrig-listen.c @@ -34,7 +34,7 @@ static void handle_signals (void) int main (int argc, char const **argv, char const *const *envp) { iopause_fd x[2] = { { -1, IOPAUSE_READ, 0 }, { -1, IOPAUSE_READ, 0 } } ; - tain_t deadline, tto ; + tain deadline, tto ; ftrigr_t a = FTRIGR_ZERO ; int argc1 ; unsigned int i = 0 ; @@ -44,7 +44,7 @@ int main (int argc, char const **argv, char const *const *envp) unsigned int t = 0 ; for (;;) { - int opt = subgetopt(argc, argv, "aot:") ; + int opt = lgetopt(argc, argv, "aot:") ; if (opt == -1) break ; switch (opt) { @@ -65,8 +65,8 @@ int main (int argc, char const **argv, char const *const *envp) tain_add_g(&deadline, &tto) ; x[0].fd = selfpipe_init() ; if (x[0].fd < 0) strerr_diefu1sys(111, "selfpipe_init") ; - if (selfpipe_trap(SIGCHLD) < 0) strerr_diefu1sys(111, "selfpipe_trap") ; - if (sig_ignore(SIGPIPE) < 0) strerr_diefu1sys(111, "ignore SIGPIPE") ; + if (!selfpipe_trap(SIGCHLD)) strerr_diefu1sys(111, "selfpipe_trap") ; + if (!sig_altignore(SIGPIPE)) strerr_diefu1sys(111, "ignore SIGPIPE") ; if (!ftrigr_startf_g(&a, &deadline)) strerr_diefu1sys(111, "ftrigr_startf") ; x[1].fd = ftrigr_fd(&a) ; @@ -81,10 +81,8 @@ int main (int argc, char const **argv, char const *const *envp) if (!ids[i]) strerr_diefu4sys(111, "subscribe to ", argv[i<<1], " with regexp ", argv[(i<<1)+1]) ; } - sig_restore(SIGPIPE) ; pid = child_spawn0(argv[argc1 + 1], argv + argc1 + 1, envp) ; if (!pid) strerr_diefu2sys(111, "spawn ", argv[argc1 + 1]) ; - if (sig_ignore(SIGPIPE) < 0) strerr_diefu1sys(111, "ignore SIGPIPE") ; for (;;) { diff --git a/src/pipe-tools/s6-ftrig-listen1.c b/src/pipe-tools/s6-ftrig-listen1.c index ecb7593..80db9b1 100644 --- a/src/pipe-tools/s6-ftrig-listen1.c +++ b/src/pipe-tools/s6-ftrig-listen1.c @@ -33,7 +33,7 @@ static void handle_signals (void) int main (int argc, char const *const *argv, char const *const *envp) { iopause_fd x[2] = { { -1, IOPAUSE_READ, 0 }, { -1, IOPAUSE_READ, 0 } } ; - tain_t deadline, tto ; + tain deadline, tto ; ftrigr_t a = FTRIGR_ZERO ; pid_t pid ; uint16_t id ; @@ -43,7 +43,7 @@ int main (int argc, char const *const *argv, char const *const *envp) unsigned int t = 0 ; for (;;) { - int opt = subgetopt(argc, argv, "t:") ; + int opt = lgetopt(argc, argv, "t:") ; if (opt == -1) break ; switch (opt) { @@ -59,20 +59,18 @@ int main (int argc, char const *const *argv, char const *const *envp) tain_now_set_stopwatch_g() ; tain_add_g(&deadline, &tto) ; - if (sig_ignore(SIGPIPE) < 0) strerr_diefu1sys(111, "sig_ignore") ; + if (!sig_altignore(SIGPIPE)) strerr_diefu1sys(111, "sig_ignore") ; if (!ftrigr_startf_g(&a, &deadline)) strerr_diefu1sys(111, "ftrigr_startf") ; id = ftrigr_subscribe_g(&a, argv[0], argv[1], 0, &deadline) ; if (!id) strerr_diefu4sys(111, "subscribe to ", argv[0], " with regexp ", argv[1]) ; x[0].fd = selfpipe_init() ; if (x[0].fd < 0) strerr_diefu1sys(111, "selfpipe_init") ; - if (selfpipe_trap(SIGCHLD) < 0) strerr_diefu1sys(111, "selfpipe_trap") ; + if (!selfpipe_trap(SIGCHLD)) strerr_diefu1sys(111, "selfpipe_trap") ; x[1].fd = ftrigr_fd(&a) ; - sig_restore(SIGPIPE) ; pid = child_spawn0(argv[2], argv+2, envp) ; if (!pid) strerr_diefu2sys(111, "spawn ", argv[2]) ; - if (sig_ignore(SIGPIPE) < 0) strerr_diefu1sys(111, "sig_ignore") ; for (;;) { diff --git a/src/pipe-tools/s6-ftrig-wait.c b/src/pipe-tools/s6-ftrig-wait.c index e703127..6cf0b25 100644 --- a/src/pipe-tools/s6-ftrig-wait.c +++ b/src/pipe-tools/s6-ftrig-wait.c @@ -13,7 +13,7 @@ int main (int argc, char const *const *argv) { - tain_t deadline, tto ; + tain deadline, tto ; ftrigr_t a = FTRIGR_ZERO ; uint16_t id ; char pack[2] = " \n" ; @@ -22,7 +22,7 @@ int main (int argc, char const *const *argv) unsigned int t = 0 ; for (;;) { - int opt = subgetopt(argc, argv, "t:") ; + int opt = lgetopt(argc, argv, "t:") ; if (opt == -1) break ; switch (opt) { diff --git a/src/pipe-tools/s6-mkfifodir.c b/src/pipe-tools/s6-mkfifodir.c index cad7d06..3a188d5 100644 --- a/src/pipe-tools/s6-mkfifodir.c +++ b/src/pipe-tools/s6-mkfifodir.c @@ -10,7 +10,7 @@ int main (int argc, char const *const *argv) { - subgetopt_t l = SUBGETOPT_ZERO ; + subgetopt l = SUBGETOPT_ZERO ; gid_t gid = -1 ; int force = 0 ; PROG = "s6-mkfifodir" ; |