From 3ed0734b7638b56fe479957f81299f79c90861e6 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sat, 9 Sep 2023 10:41:49 +0000 Subject: Adapt to skalibs-2.14 Signed-off-by: Laurent Bercot --- src/execline/backtick.c | 1 + src/execline/trap.c | 7 ++++--- src/libexecline/el_spawn0.c | 6 +++--- src/libexecline/el_spawn1.c | 3 ++- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/execline/backtick.c b/src/execline/backtick.c index 881c06a..06996bb 100644 --- a/src/execline/backtick.c +++ b/src/execline/backtick.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include diff --git a/src/execline/trap.c b/src/execline/trap.c index b409d77..62526ed 100644 --- a/src/execline/trap.c +++ b/src/execline/trap.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -36,7 +37,7 @@ static inline void trap_action (unsigned int i, char const *const *envp, size_t modif[m++] = 0 ; if (!env_mergen(newenvp, envlen + 3, envp, envlen, modif, m, 2)) strerr_diefu1sys(111, "adjust environment for child") ; - pids[i] = child_spawn0(argvs[i][0], argvs[i], newenvp) ; + pids[i] = cspawn(argvs[i][0], argvs[i], newenvp, CSPAWN_FLAGS_SELFPIPE_FINISH, 0, 0) ; if (!pids[i]) strerr_diefu2sys(111, "spawn ", argvs[i][0]) ; } } @@ -118,10 +119,10 @@ int main (int argc, char const **argv, char const *const *envp) } x.fd = selfpipe_init() ; - if (x.fd < 0) strerr_diefu1sys(111, "selfpipe_init") ; + if (x.fd == -1) strerr_diefu1sys(111, "selfpipe_init") ; if (!selfpipe_trapset(&set)) strerr_diefu1sys(111, "trap signals") ; - pids[SKALIBS_NSIG] = child_spawn0(argv[argc1 + 1], argv + argc1 + 1, envp) ; + pids[SKALIBS_NSIG] = cspawn(argv[argc1 + 1], argv + argc1 + 1, envp, CSPAWN_FLAGS_SELFPIPE_FINISH, 0, 0) ; if (!pids[SKALIBS_NSIG]) strerr_diefu2sys(111, "spawn ", argv[argc1 + 1]) ; loop: diff --git a/src/libexecline/el_spawn0.c b/src/libexecline/el_spawn0.c index 0cfe017..d4265a4 100644 --- a/src/libexecline/el_spawn0.c +++ b/src/libexecline/el_spawn0.c @@ -1,6 +1,6 @@ /* ISC license. */ -#include +#include #include #include @@ -10,7 +10,7 @@ pid_t el_spawn0 (char const *prog, char const *const *argv, char const *const *e if (!argv[0]) { static char const *const newargv[3] = { EXECLINE_BINPREFIX "exit", "0", 0 } ; - return child_spawn0(newargv[0], newargv, 0) ; + return cspawn(newargv[0], newargv, envp, 0, 0, 0) ; } - else return child_spawn0(prog, argv, envp) ; + else return cspawn(prog, argv, envp, 0, 0, 00) ; } diff --git a/src/libexecline/el_spawn1.c b/src/libexecline/el_spawn1.c index 937f1a3..d9a7f87 100644 --- a/src/libexecline/el_spawn1.c +++ b/src/libexecline/el_spawn1.c @@ -1,6 +1,7 @@ /* ISC license. */ -#include +#include + #include #include -- cgit 1.4.1