diff options
Diffstat (limited to 'src/tls/s6-ucspitlsd.c')
-rw-r--r-- | src/tls/s6-ucspitlsd.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/tls/s6-ucspitlsd.c b/src/tls/s6-ucspitlsd.c index 37ec435..ecce9d5 100644 --- a/src/tls/s6-ucspitlsd.c +++ b/src/tls/s6-ucspitlsd.c @@ -9,6 +9,7 @@ #include <skalibs/strerr.h> #include <skalibs/djbunix.h> #include <skalibs/socket.h> +#include <skalibs/exec.h> #include <s6-networking/config.h> #include "s6tls-internal.h" @@ -19,13 +20,15 @@ static inline void child (int [4][2], uint32_t, unsigned int, unsigned int, unsigned int, pid_t) gccattr_noreturn ; static inline void child (int p[4][2], uint32_t options, unsigned int verbosity, unsigned int kimeout, unsigned int snilevel, pid_t pid) { - int fds[3] = { p[0][0], p[1][1], p[2][1] } ; + char const *newargv[S6TLS_PREP_IO_ARGC] ; + char buf[S6TLS_PREP_IO_BUFLEN] ; ssize_t r ; char c ; PROG = "s6-ucspitlsd" ; close(p[2][0]) ; close(p[0][1]) ; close(p[1][0]) ; + s6tls_prep_tlsdio(newargv, buf, p[0][0], p[1][1], p[2][1], options, verbosity, kimeout, snilevel) ; r = read(p[2][1], &c, 1) ; if (r < 0) strerr_diefu1sys(111, "read from control socket") ; if (!r) @@ -42,7 +45,7 @@ static inline void child (int p[4][2], uint32_t options, unsigned int verbosity, { case 'y' : close(p[2][1]) ; - p[2][1] = 0 ; /* we know 0 is open so it's a correct invalid value */ + p[2][1] = 0 ; /* we know 0 is open so it's a suitable invalid value */ break ; case 'Y' : fd_shutdown(p[2][1], 0) ; @@ -56,7 +59,7 @@ static inline void child (int p[4][2], uint32_t options, unsigned int verbosity, fmt[pid_fmt(fmt, pid)] = 0 ; strerr_warni4x("pid ", fmt, " accepted", " opportunistic TLS") ; } - s6tls_exec_tlsdio(fds, options, verbosity, kimeout, snilevel) ; + xexec(newargv) ; } int main (int argc, char const *const *argv) |