From 13aa9bd172ec10cd8d3ddae6c7159dbe9bf91535 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sun, 28 Apr 2019 11:59:05 +0000 Subject: s6-linux-init: better internal API for envmodifs passing --- NEWS | 3 ++- src/init/s6-linux-init.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index f5300c6..846edab 100644 --- a/NEWS +++ b/NEWS @@ -3,11 +3,12 @@ Changelog for s6-linux-init. In 1.0.0.0 ---------- - - Entirely different approach, see the documentation overview. + - Complete rework; see the documentation overview. - s6-halt, s6-poweroff, s6-reboot removed. - s6-linux-init-maker now produces a set of executable scripts that are a drop-in replacement for a sysvinit installation, and that respect the LSB-3.0.0 specification. + - utmp management, runlevel management. In 0.4.0.1 diff --git a/src/init/s6-linux-init.c b/src/init/s6-linux-init.c index 94a2054..5223d54 100644 --- a/src/init/s6-linux-init.c +++ b/src/init/s6-linux-init.c @@ -37,7 +37,7 @@ static inline char const *scan_cmdline (char const *initdefault, char const *con return initdefault ; } -static inline void run_stage2 (char const *basedir, char const **argv, unsigned int argc, char const *const *envp, size_t envlen, stralloc *envmodifs, char const *initdefault) +static inline void run_stage2 (char const *basedir, char const **argv, unsigned int argc, char const *const *envp, size_t envlen, char const *modifs, size_t modiflen, char const *initdefault) { size_t dirlen = strlen(basedir) ; char const *childargv[argc + 3] ; @@ -58,7 +58,7 @@ static inline void run_stage2 (char const *basedir, char const **argv, unsigned strerr_diefu1sys(111, "open " LOGFIFO " for writing") ; if (fd_copy(2, 1) == -1) strerr_diefu1sys(111, "fd_copy stdout to stderr") ; - xpathexec_r(childargv, envp, envlen, envmodifs->s, envmodifs->len) ; + xpathexec_r(childargv, envp, envlen, modifs, modiflen) ; } int main (int argc, char const **argv, char const *const *envp) @@ -167,7 +167,7 @@ int main (int argc, char const **argv, char const *const *envp) } pid = fork() ; if (pid == -1) strerr_diefu1sys(111, "fork") ; - if (!pid) run_stage2(basedir, argv, argc, newenvp, !!path, &envmodifs, initdefault) ; + if (!pid) run_stage2(basedir, argv, argc, newenvp, !!path, envmodifs.s, envmodifs.len, initdefault) ; if (fd_copy(2, 1) == -1) strerr_diefu1sys(111, "redirect output file descriptor") ; xpathexec_r(newargv, newenvp, !!path, envmodifs.s, envmodifs.len) ; -- cgit v1.2.3