diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2020-11-28 12:38:56 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2020-11-28 12:38:56 +0000 |
commit | 1f7a397ea589f31ab8e8eed72ebc2933ddb229a9 (patch) | |
tree | cb4e418146839514fbca2f805a7a4e4ee3918324 /src/daemontools-extras/s6-fghack.c | |
parent | bdef68e12278ddfc5080732bd3b28dd5135c9d3a (diff) | |
download | s6-1f7a397ea589f31ab8e8eed72ebc2933ddb229a9.tar.xz |
Adapt to new exec.h
Diffstat (limited to 'src/daemontools-extras/s6-fghack.c')
-rw-r--r-- | src/daemontools-extras/s6-fghack.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/daemontools-extras/s6-fghack.c b/src/daemontools-extras/s6-fghack.c index 5981b96..a2f1f2b 100644 --- a/src/daemontools-extras/s6-fghack.c +++ b/src/daemontools-extras/s6-fghack.c @@ -3,13 +3,15 @@ #include <unistd.h> #include <errno.h> #include <sys/wait.h> + #include <skalibs/strerr2.h> #include <skalibs/allreadwrite.h> #include <skalibs/djbunix.h> +#include <skalibs/exec.h> #define USAGE "s6-fghack prog..." -int main (int argc, char const *const *argv, char const *const *envp) +int main (int argc, char const *const *argv) { int p[2] ; int pcoe[2] ; @@ -26,19 +28,19 @@ int main (int argc, char const *const *argv, char const *const *envp) case 0 : { int i = 0 ; - fd_close(p[0]) ; - fd_close(pcoe[0]) ; + close(p[0]) ; + close(pcoe[0]) ; if (coe(pcoe[1]) < 0) _exit(111) ; for (; i < 30 ; i++) dup(p[1]) ; /* hack. gcc's warning is justified. */ - pathexec_run(argv[1], argv+1, envp) ; + exec(argv+1) ; i = errno ; if (fd_write(pcoe[1], "", 1) < 1) _exit(111) ; _exit(i) ; } } - fd_close(p[1]) ; - fd_close(pcoe[1]) ; + close(p[1]) ; + close(pcoe[1]) ; switch (fd_read(pcoe[0], &dummy, 1)) { |