diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-12-22 16:44:47 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-12-22 16:44:47 +0000 |
commit | a8e40d0287f05f6e444035431b1cc7b340fe8d79 (patch) | |
tree | 3d34decfcdfed87f14ab6b467dfd8ca3c7add471 /src/libstddjb/child_spawn2.c | |
parent | 8cd0d07171f8b32553ef0c6936fd5737adcb4bab (diff) | |
download | skalibs-a8e40d0287f05f6e444035431b1cc7b340fe8d79.tar.xz |
Deprecate env_get
Diffstat (limited to 'src/libstddjb/child_spawn2.c')
-rw-r--r-- | src/libstddjb/child_spawn2.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libstddjb/child_spawn2.c b/src/libstddjb/child_spawn2.c index 0f08b3d..01f144d 100644 --- a/src/libstddjb/child_spawn2.c +++ b/src/libstddjb/child_spawn2.c @@ -9,14 +9,12 @@ #include <unistd.h> #include <errno.h> #include <signal.h> -#include <skalibs/djbunix.h> #ifdef SKALIBS_HASPOSIXSPAWN #include <stdlib.h> #include <spawn.h> #include <skalibs/config.h> -#include <skalibs/env.h> #else @@ -27,6 +25,8 @@ #endif +#include <skalibs/djbunix.h> + pid_t child_spawn2 (char const *prog, char const *const *argv, char const *const *envp, int *fds) { #ifdef SKALIBS_HASPOSIXSPAWN @@ -65,7 +65,7 @@ pid_t child_spawn2 (char const *prog, char const *const *argv, char const *const e = posix_spawn_file_actions_addclose(&actions, p[0][1]) ; if (e) goto erractions ; { - int haspath = !!env_get("PATH") ; + int haspath = !!getenv("PATH") ; if (!haspath && (setenv("PATH", SKALIBS_DEFAULTPATH, 0) < 0)) { e = errno ; goto erractions ; @@ -98,8 +98,8 @@ pid_t child_spawn2 (char const *prog, char const *const *argv, char const *const syncdie: { - unsigned char c = errno ; - fd_write(syncpipe[1], (char const *)&c, 1) ; + char c = errno ; + fd_write(syncpipe[1], &c, 1) ; } _exit(127) ; } |