diff options
-rw-r--r-- | src/execline/backtick.c | 1 | ||||
-rw-r--r-- | src/execline/trap.c | 7 | ||||
-rw-r--r-- | src/libexecline/el_spawn0.c | 6 | ||||
-rw-r--r-- | 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 <skalibs/sgetopt.h> #include <skalibs/strerr.h> #include <skalibs/stralloc.h> +#include <skalibs/cspawn.h> #include <skalibs/djbunix.h> #include <skalibs/exec.h> 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 <skalibs/iopause.h> #include <skalibs/selfpipe.h> #include <skalibs/env.h> +#include <skalibs/cspawn.h> #include <skalibs/djbunix.h> #include <execline/execline.h> @@ -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 <skalibs/djbunix.h> +#include <skalibs/cspawn.h> #include <execline/config.h> #include <execline/execline.h> @@ -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 <skalibs/djbunix.h> +#include <skalibs/cspawn.h> + #include <execline/config.h> #include <execline/execline.h> |