diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2023-02-11 03:12:21 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2023-02-11 03:12:21 +0000 |
commit | 774654ad56fc9304e4a064232760835c7a2a6c13 (patch) | |
tree | 3f539521073866497ff0370d8a6464c9356cadb4 /src/skaembutils/s6-env.c | |
parent | 790c8681d3451b61a536871dad234fc294796fd8 (diff) | |
download | s6-portable-utils-774654ad56fc9304e4a064232760835c7a2a6c13.tar.xz |
Add multicall configuration
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/skaembutils/s6-env.c')
-rw-r--r-- | src/skaembutils/s6-env.c | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/skaembutils/s6-env.c b/src/skaembutils/s6-env.c deleted file mode 100644 index 01479ce..0000000 --- a/src/skaembutils/s6-env.c +++ /dev/null @@ -1,43 +0,0 @@ -/* ISC license. */ - -#include <string.h> -#include <errno.h> - -#include <skalibs/sgetopt.h> -#include <skalibs/strerr.h> -#include <skalibs/env.h> -#include <skalibs/exec.h> - -#include <s6-portable-utils/config.h> - -#define USAGE "s6-env [ -i ] [ name=value... ] prog..." - -int main (int argc, char const *const *argv, char const *const *envp) -{ - stralloc modifs = STRALLOC_ZERO ; - char const *arg_zero[2] = { S6_PORTABLE_UTILS_BINPREFIX "s6-printenv", 0 } ; - char const *env_zero[1] = { 0 } ; - PROG = "s6-env" ; - { - subgetopt l = SUBGETOPT_ZERO ; - for (;;) - { - int opt = subgetopt_r(argc, argv, "i", &l) ; - if (opt == -1) break ; - switch (opt) - { - case 'i': envp = env_zero ; break ; - default : strerr_dieusage(100, USAGE) ; - } - } - argc -= l.ind ; argv += l.ind ; - } - for (; argc ; argc--, argv++) - { - if (!strchr(*argv, '=')) break ; - if (!stralloc_cats(&modifs, *argv) || !stralloc_0(&modifs)) - strerr_diefu1sys(111, "stralloc_cats") ; - } - if (!argc) argv = arg_zero ; - xmexec_em(argv, envp, modifs.s, modifs.len) ; -} |