summaryrefslogtreecommitdiff
path: root/src/daemontools-extras/s6-fghack.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2020-11-28 12:38:56 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2020-11-28 12:38:56 +0000
commit1f7a397ea589f31ab8e8eed72ebc2933ddb229a9 (patch)
treecb4e418146839514fbca2f805a7a4e4ee3918324 /src/daemontools-extras/s6-fghack.c
parentbdef68e12278ddfc5080732bd3b28dd5135c9d3a (diff)
downloads6-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.c14
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))
{