summaryrefslogtreecommitdiff
path: root/src/tls/s6tls_io_spawn.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/s6tls_io_spawn.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/s6tls_io_spawn.c')
-rw-r--r--src/tls/s6tls_io_spawn.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/tls/s6tls_io_spawn.c b/src/tls/s6tls_io_spawn.c
index 252ddb5..aa7764c 100644
--- a/src/tls/s6tls_io_spawn.c
+++ b/src/tls/s6tls_io_spawn.c
@@ -5,15 +5,15 @@
#include "s6tls-internal.h"
-pid_t s6tls_io_spawn (char const *const *argv, int const p[4][2])
+pid_t s6tls_io_spawn (char const *const *argv, int const *p, int isc)
{
cspawn_fileaction fa[5] =
{
- [0] = { .type = CSPAWN_FA_CLOSE, .x = { .fd = p[0][1] } },
- [1] = { .type = CSPAWN_FA_CLOSE, .x = { .fd = p[1][0] } },
- [2] = { .type = CSPAWN_FA_CLOSE, .x = { .fd = p[2][0] } },
- [3] = { .type = CSPAWN_FA_MOVE, .x = { .fd2 = { [0] = 0, [1] = p[3][0] } } },
- [4] = { .type = CSPAWN_FA_MOVE, .x = { .fd2 = { [0] = 1, [1] = p[3][1] } } }
+ { .type = CSPAWN_FA_CLOSE, .x = { .fd = p[1] } },
+ { .type = CSPAWN_FA_CLOSE, .x = { .fd = p[2] } },
+ { .type = CSPAWN_FA_CLOSE, .x = { .fd = p[4] } },
+ { .type = CSPAWN_FA_MOVE, .x = { .fd2 = { 0, p[0] } } },
+ { .type = CSPAWN_FA_MOVE, .x = { .fd2 = { 1, p[3] } } }
} ;
- return cspawn(argv[0], argv, (char const *const *)environ, 0, fa, 5) ;
+ return cspawn(argv[0], argv, (char const *const *)environ, 0, fa, isc ? 5 : 3) ;
}