about summary refs log tree commit diff
path: root/src/supervision
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2020-01-16 16:56:49 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2020-01-16 16:56:49 +0000
commit67fe7156d9e5fb07d87742e148918329c362ae78 (patch)
tree0483dc5bcb7e64ab197291e2087f05e3fdb0e11f /src/supervision
parente22ada794ba3ab78bd84036ca045ce748d8671e5 (diff)
downloads6-67fe7156d9e5fb07d87742e148918329c362ae78.tar.gz
s6-67fe7156d9e5fb07d87742e148918329c362ae78.tar.xz
s6-67fe7156d9e5fb07d87742e148918329c362ae78.zip
Use execv() where applicable
Diffstat (limited to 'src/supervision')
-rw-r--r--src/supervision/s6-supervise.c5
-rw-r--r--src/supervision/s6-svscan.c6
2 files changed, 5 insertions, 6 deletions
diff --git a/src/supervision/s6-supervise.c b/src/supervision/s6-supervise.c
index 5c431db..da6a187 100644
--- a/src/supervision/s6-supervise.c
+++ b/src/supervision/s6-supervise.c
@@ -19,7 +19,6 @@
 #include <skalibs/djbunix.h>
 #include <skalibs/sig.h>
 #include <skalibs/selfpipe.h>
-#include <skalibs/environ.h>
 #include <skalibs/skamisc.h>
 #include <s6/ftrigw.h>
 #include <s6/s6-supervise.h>
@@ -279,7 +278,7 @@ static void trystart (void)
       failcoe(p[1]) ;
       strerr_diefu1sys(127, "access ./nosetsid") ;
     }
-    execve("./run", (char *const *)cargv, (char *const *)environ) ;
+    execv("./run", (char *const *)cargv) ;
     failcoe(p[1]) ;
     strerr_dieexec(127, "run") ;
   }
@@ -397,7 +396,7 @@ static int uplastup_z (void)
     fmt0[uint_fmt(fmt0, WIFSIGNALED(status.wstat) ? 256 : WEXITSTATUS(status.wstat))] = 0 ;
     fmt1[uint_fmt(fmt1, WTERMSIG(status.wstat))] = 0 ;
     maybesetsid() ;
-    execve("./finish", cargv, (char *const *)environ) ;
+    execv("./finish", cargv) ;
     _exit(127) ;
   }
   status.flagfinishing = 1 ;
diff --git a/src/supervision/s6-svscan.c b/src/supervision/s6-svscan.c
index ebf7594..800fc9f 100644
--- a/src/supervision/s6-svscan.c
+++ b/src/supervision/s6-svscan.c
@@ -70,8 +70,8 @@ static void panicnosp (char const *errmsg)
   char const *eargv[2] = { CRASH_PROG, 0 } ;
   strerr_warnwu1sys(errmsg) ;
   strerr_warnw2x("executing into ", eargv[0]) ;
-  execve(eargv[0], (char *const *)eargv, (char *const *)environ) ;
- /* and if that execve fails, screw it and just die */
+  execv(eargv[0], (char *const *)eargv) ;
+ /* and if that exec fails, screw it and just die */
   strerr_dieexec(111, eargv[0]) ;
 }
 
@@ -580,7 +580,7 @@ int main (int argc, char const *const *argv)
   }
   {
     char const *eargv[3] = { FINISH_PROG, finish_arg, 0 } ;
-    execve(eargv[0], (char **)eargv, (char *const *)environ) ;
+    execv(eargv[0], (char **)eargv) ;
   }
   panicnosp("exec finish script " FINISH_PROG) ;
 }