diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2023-09-08 08:38:06 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2023-09-08 08:38:06 +0000 |
commit | 7113c4cf792ec44ec04a54e9723fa31a97bee5a7 (patch) | |
tree | cb13b4316f0a164e83ffba5ca603dcf11c26045c /src/tls/s6-tlsd.c | |
parent | 9efa646c7fb520747804acdc829b3cccea0dce63 (diff) | |
download | s6-networking-7113c4cf792ec44ec04a54e9723fa31a97bee5a7.tar.xz |
Refactor s6-tls[cd] so they're ready to port to posix_spawn
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/tls/s6-tlsd.c')
-rw-r--r-- | src/tls/s6-tlsd.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/tls/s6-tlsd.c b/src/tls/s6-tlsd.c index 49c38c1..c9ef5d2 100644 --- a/src/tls/s6-tlsd.c +++ b/src/tls/s6-tlsd.c @@ -9,6 +9,7 @@ #include <skalibs/strerr.h> #include <skalibs/env.h> #include <skalibs/djbunix.h> +#include <skalibs/exec.h> #include "s6tls-internal.h" @@ -18,12 +19,14 @@ static void child (int const [4][2], uint32_t, unsigned int, unsigned int, unsigned int) gccattr_noreturn ; static void child (int const p[4][2], uint32_t options, unsigned int verbosity, unsigned int kimeout, unsigned int snilevel) { - 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] ; PROG = "s6-tlsd (child)" ; close(p[2][0]) ; close(p[0][1]) ; close(p[1][0]) ; - s6tls_exec_tlsdio(fds, options, verbosity, kimeout, snilevel) ; + s6tls_prep_tlsdio(newargv, buf, p[0][0], p[1][1], p[2][1], options, verbosity, kimeout, snilevel) ; + xexec(newargv) ; } int main (int argc, char const *const *argv) |