summaryrefslogtreecommitdiff
path: root/src/daemontools-extras/s6-fghack.c
diff options
context:
space:
mode:
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))
{