From 68990372b2a0eb3cdf998933dc0d01b76a0ebe85 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 25 Dec 2017 02:45:41 +0000 Subject: Remove env_get --- src/skaembutils/s6-chown.c | 7 ++++--- src/skaembutils/s6-test.c | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src/skaembutils') diff --git a/src/skaembutils/s6-chown.c b/src/skaembutils/s6-chown.c index a557642..25db44f 100644 --- a/src/skaembutils/s6-chown.c +++ b/src/skaembutils/s6-chown.c @@ -1,6 +1,7 @@ /* ISC license. */ #include +#include #include #include #include @@ -8,7 +9,7 @@ #define USAGE "s6-chown [ -U ] [ -u uid ] [ -g gid ] file" -int main (int argc, char const *const *argv, char const *const *envp) +int main (int argc, char const *const *argv) { uid_t uid = -1 ; gid_t gid = -1 ; @@ -33,10 +34,10 @@ int main (int argc, char const *const *argv, char const *const *envp) } case 'U': { - char const *s = env_get2(envp, "UID") ; + char const *s = getenv("UID") ; if (!s) strerr_dienotset(100, "UID") ; if (!uid0_scan(s, &uid)) strerr_dieinvalid(100, "UID") ; - s = env_get2(envp, "GID") ; + s = getenv("GID") ; if (!s) strerr_dienotset(100, "GID") ; if (!gid0_scan(s, &gid)) strerr_dieinvalid(100, "GID") ; break ; diff --git a/src/skaembutils/s6-test.c b/src/skaembutils/s6-test.c index 474eded..be8201b 100644 --- a/src/skaembutils/s6-test.c +++ b/src/skaembutils/s6-test.c @@ -3,9 +3,9 @@ #include #include #include +#include #include #include -#include #include #define USAGE "s6-test expression... or [ expression... ]" @@ -491,7 +491,7 @@ static int run (struct node const *tree, unsigned int root) return n1 <= n2 ; } case T_ENV : - return !!env_get(tree[tree[root].arg1].data) ; + return !!getenv(tree[tree[root].arg1].data) ; default: strerr_dief1x(111, "operation not implemented") ; } -- cgit v1.2.3