diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/s6-rc/s6-rc-update.c | 5 | ||||
-rw-r--r-- | src/s6-rc/s6-rc.c | 9 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/s6-rc/s6-rc-update.c b/src/s6-rc/s6-rc-update.c index 617cdfb..7387e07 100644 --- a/src/s6-rc/s6-rc-update.c +++ b/src/s6-rc/s6-rc-update.c @@ -19,6 +19,7 @@ #include <skalibs/cdb.h> #include <skalibs/stralloc.h> #include <skalibs/tai.h> +#include <skalibs/cspawn.h> #include <skalibs/djbunix.h> #include <skalibs/exec.h> #include <skalibs/skamisc.h> @@ -537,7 +538,7 @@ static inline void update_fdholder (s6rc_db_t const *olddb, unsigned char const char const *newargv[7] = { S6_EXTBINPREFIX "s6-svc", "-T", tfmt, "-twR", "--", fnsocket, 0 } ; fill_tfmt(tfmt, deadline) ; fnsocket[livelen + sizeof("/servicedirs/" S6RC_FDHOLDER) - 1] = 0 ; - pid = child_spawn0(newargv[0], newargv, envp) ; + pid = cspawn(newargv[0], newargv, envp, 0, 0, 0) ; if (!pid) strerr_diefu2sys(111, "spawn ", newargv[0]) ; if (wait_pid(pid, &wstat) < 0) strerr_diefu1sys(111, "waitpid") ; tain_now_g() ; @@ -740,7 +741,7 @@ int main (int argc, char const *const *argv, char const *const *envp) newargv[m++] = 0 ; if (verbosity >= 2) strerr_warni1x("stopping services in the old database") ; - pid = child_spawn0(newargv[0], newargv, envp) ; + pid = cspawn(newargv[0], newargv, envp, 0, 0, 0) ; if (!pid) strerr_diefu2sys(111, "spawn ", newargv[0]) ; if (wait_pid(pid, &wstat) < 0) strerr_diefu1sys(111, "waitpid") ; tain_now_g() ; diff --git a/src/s6-rc/s6-rc.c b/src/s6-rc/s6-rc.c index e4822a3..1dee5f9 100644 --- a/src/s6-rc/s6-rc.c +++ b/src/s6-rc/s6-rc.c @@ -15,6 +15,7 @@ #include <skalibs/strerr.h> #include <skalibs/tai.h> #include <skalibs/sig.h> +#include <skalibs/cspawn.h> #include <skalibs/djbunix.h> #include <skalibs/selfpipe.h> #include <skalibs/iopause.h> @@ -159,7 +160,7 @@ static inline pid_t start_oneshot (unsigned int i, int h) newargv[m++] = db->string + db->services[i].name ; } newargv[m++] = 0 ; - return child_spawn0(newargv[0], newargv, (char const *const *)environ) ; + return cspawn(newargv[0], newargv, (char const *const *)environ, CSPAWN_FLAGS_SELFPIPE_FINISH, 0, 0) ; } static inline pid_t start_longrun (unsigned int i, int h) @@ -202,7 +203,7 @@ static inline pid_t start_longrun (unsigned int i, int h) newargv[m++] = "--" ; newargv[m++] = servicefn ; newargv[m++] = 0 ; - return child_spawn0(newargv[0], newargv, (char const *const *)environ) ; + return cspawn(newargv[0], newargv, (char const *const *)environ, CSPAWN_FLAGS_SELFPIPE_FINISH, 0, 0) ; } static inline void success_longrun (unsigned int i, int h) @@ -243,7 +244,7 @@ static inline void failure_longrun (unsigned int i, int h) memcpy(fn, live, livelen) ; memcpy(fn + livelen, "/servicedirs/", 13) ; memcpy(fn + livelen + 13, db->string + db->services[i].name, svdlen + 1) ; - if (!child_spawn0(newargv[0], newargv, (char const *const *)environ)) + if (!cspawn(newargv[0], newargv, (char const *const *)environ, CSPAWN_FLAGS_SELFPIPE_FINISH, 0, 0)) strerr_warnwu2sys("spawn ", newargv[0]) ; } } @@ -329,7 +330,7 @@ static inline void kill_oneshots (void) memcpy(fn, live, livelen) ; memcpy(fn + livelen, "/servicedirs/", 13) ; memcpy(fn + livelen + 13, S6RC_ONESHOT_RUNNER, S6RC_ONESHOT_RUNNER_LEN + 1) ; - if (!child_spawn0(newargv[0], newargv, (char const *const *)environ)) + if (!cspawn(newargv[0], newargv, (char const *const *)environ, CSPAWN_FLAGS_SELFPIPE_FINISH, 0, 0)) strerr_warnwu2sys("spawn ", newargv[0]) ; } */ |