summaryrefslogtreecommitdiff
path: root/src/tls/s6-ucspitlsd.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2023-11-10 11:28:19 +0000
committerLaurent Bercot <ska@appnovation.com>2023-11-10 11:28:19 +0000
commit1e10d30b41b65dbd520e01adc5fe686cb92b0f12 (patch)
tree32af8327cb6bb9aa6bbd5e20ee7a2cc1f9c95263 /src/tls/s6-ucspitlsd.c
parentc930181234bfb31fba0136d866e6e75633acafe0 (diff)
downloads6-networking-1e10d30b41b65dbd520e01adc5fe686cb92b0f12.tar.xz
Prepare for 2.7.0.0. Better s6-tlsc-io interface.
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/tls/s6-ucspitlsd.c')
-rw-r--r--src/tls/s6-ucspitlsd.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/tls/s6-ucspitlsd.c b/src/tls/s6-ucspitlsd.c
index 92450e3..fc0868a 100644
--- a/src/tls/s6-ucspitlsd.c
+++ b/src/tls/s6-ucspitlsd.c
@@ -17,18 +17,18 @@
#define USAGE "s6-ucspitlsd [ -S | -s ] [ -Y | -y ] [ -k snilevel ] [ -v verbosity ] [ -K timeout ] [ -Z | -z ] prog..."
#define dieusage() strerr_dieusage(100, USAGE)
-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)
+static inline void child (int *, uint32_t, unsigned int, unsigned int, unsigned int, pid_t) gccattr_noreturn ;
+static inline void child (int *p, uint32_t options, unsigned int verbosity, unsigned int kimeout, unsigned int snilevel, pid_t pid)
{
ssize_t r ;
char const *newargv[S6TLS_PREP_IO_ARGC] ;
char buf[S6TLS_PREP_IO_BUFLEN] ;
char c ;
PROG = "s6-ucspitlsd" ;
- close(p[2][0]) ;
- close(p[0][1]) ;
- close(p[1][0]) ;
- r = read(p[2][1], &c, 1) ;
+ close(p[4]) ;
+ close(p[1]) ;
+ close(p[2]) ;
+ r = read(p[5], &c, 1) ;
if (r < 0) strerr_diefu1sys(111, "read from control socket") ;
if (!r)
{
@@ -43,11 +43,11 @@ static inline void child (int p[4][2], uint32_t options, unsigned int verbosity,
switch (c)
{
case 'y' :
- close(p[2][1]) ;
- p[2][1] = 0 ; /* we know 0 is open so it's a suitable invalid value */
+ close(p[5]) ;
+ p[5] = 0 ; /* we know 0 is open so it's a suitable invalid value */
break ;
case 'Y' :
- fd_shutdown(p[2][1], 0) ;
+ fd_shutdown(p[5], 0) ;
break ;
default :
strerr_dief1x(100, "unrecognized command on control socket") ;
@@ -67,9 +67,9 @@ int main (int argc, char const *const *argv)
unsigned int verbosity = 1 ;
unsigned int kimeout = 0 ;
unsigned int snilevel = 0 ;
- int p[4][2] = { [3] = { [0] = -1, [1] = -1 } } ;
uint32_t coptions = 0 ;
uint32_t poptions = 1 ;
+ int p[6] ;
pid_t pid ;
PROG = "s6-ucspitlsd (parent)" ;
@@ -97,8 +97,8 @@ int main (int argc, char const *const *argv)
}
if (!argc) dieusage() ;
- if (ipc_pair_b(p[2]) == -1) strerr_diefu1sys(111, "ipc_pair") ;
- if (pipe(p[0]) == -1 || pipe(p[1]) == -1) strerr_diefu1sys(111, "pipe") ;
+ if (pipe(p) == -1 || pipe(p+2) == -1) strerr_diefu1sys(111, "pipe") ;
+ if (ipc_pair_b(p+4) == -1) strerr_diefu1sys(111, "ipc_pair") ;
pid = getpid() ;
switch (fork())