aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/s6-frontend/live_status.c22
-rw-r--r--src/s6-frontend/process_kill.c2
-rw-r--r--src/s6-frontend/process_restart.c2
-rw-r--r--src/s6-frontend/process_status.c2
-rw-r--r--src/s6-frontend/s6-frontend.c4
5 files changed, 21 insertions, 11 deletions
diff --git a/src/s6-frontend/live_status.c b/src/s6-frontend/live_status.c
index e657bc2..2a3a9af 100644
--- a/src/s6-frontend/live_status.c
+++ b/src/s6-frontend/live_status.c
@@ -1,5 +1,6 @@
/* ISC license. */
+#include <string.h>
#include <unistd.h>
#include <sys/wait.h>
@@ -27,24 +28,33 @@
static void live_status_all (int withe) gccattr_noreturn ;
static void live_status_all (int withe)
{
- char const *argv[17] ;
unsigned int m = 0 ;
+ size_t llen = strlen(g->dirs.live) ;
+ char const *argv[21] ;
+ char llivedir[llen + 3] ;
+ llivedir[0] = ' ' ; llivedir[1] = ' ' ;
+ memcpy(llivedir + 2, g->dirs.live, llen + 1) ;
+
argv[m++] = EXECLINE_EXTBINPREFIX "if" ;
argv[m++] = " " EXECLINE_EXTBINPREFIX "pipeline" ;
argv[m++] = " " S6RC_EXTBINPREFIX "s6-rc" ;
+ argv[m++] = " -l" ;
+ argv[m++] = llivedir ;
argv[m++] = withe ? " -buaE" : " -buae" ;
argv[m++] = " list" ;
argv[m++] = " " ;
argv[m++] = " sed" ;
- argv[m++] = " s|$|/up" ;
+ argv[m++] = " s|$|/up|" ;
argv[m++] = "" ;
argv[m++] = EXECLINE_EXTBINPREFIX "pipeline" ;
argv[m++] = " " S6RC_EXTBINPREFIX "s6-rc" ;
+ argv[m++] = " -l" ;
+ argv[m++] = llivedir + 1 ;
argv[m++] = withe ? " -bdaE" : " -bdae" ;
argv[m++] = " list" ;
argv[m++] = "" ;
argv[m++] = "sed" ;
- argv[m++] = "s|$|/down" ;
+ argv[m++] = "s|$|/down|" ;
argv[m++] = 0 ;
main_pretty_exec(argv) ;
}
@@ -163,7 +173,7 @@ static void live_status_some (char const *const *services, int withe)
argv[m++] = " /dev/fd/3" ;
argv[m++] = " " ;
argv[m++] = " sed" ;
- argv[m++] = " s|$|/up" ;
+ argv[m++] = " s|$|/up|" ;
argv[m++] = "" ;
argv[m++] = EXECLINE_EXTBINPREFIX "piperw" ;
argv[m++] = "3" ;
@@ -189,7 +199,7 @@ static void live_status_some (char const *const *services, int withe)
argv[m++] = " /dev/fd/3" ;
argv[m++] = "" ;
argv[m++] = "sed" ;
- argv[m++] = "s|$|/down" ;
+ argv[m++] = "s|$|/down|" ;
argv[m++] = 0 ;
main_pretty_exec(argv) ;
}
@@ -209,6 +219,6 @@ void live_status (char const *const *argv)
uint64_t wgolb = 0 ;
argv += gol_argv(argv, rgolb, 2, 0, 0, &wgolb, 0) ;
- if (!argv) live_status_all(wgolb & GOLB_INCLUDE_ESSENTIALS) ;
+ if (!*argv) live_status_all(wgolb & GOLB_INCLUDE_ESSENTIALS) ;
else live_status_some(argv, wgolb & GOLB_INCLUDE_ESSENTIALS) ;
}
diff --git a/src/s6-frontend/process_kill.c b/src/s6-frontend/process_kill.c
index a17a141..64a97af 100644
--- a/src/s6-frontend/process_kill.c
+++ b/src/s6-frontend/process_kill.c
@@ -102,7 +102,7 @@ void process_kill (char const *const *argv)
char svcopt[5] = "-!\0\0\0" ;
argv += GOL_argv(argv, rgolb, rgola, &wgolb, wgola) ;
- if (!argv) dieusage() ;
+ if (!*argv) dieusage() ;
if (wgola[GOLA_SIGNAL])
{
if (!sig0_scan(wgola[GOLA_SIGNAL], &sig))
diff --git a/src/s6-frontend/process_restart.c b/src/s6-frontend/process_restart.c
index a1f6a9b..5ca11c7 100644
--- a/src/s6-frontend/process_restart.c
+++ b/src/s6-frontend/process_restart.c
@@ -39,7 +39,7 @@ void process_restart (char const *const *argv)
unsigned int timeout = 0 ;
unsigned int argc ;
argv += GOL_argv(argv, rgolb, rgola, &wgolb, wgola) ;
- if (!argv) dieusage() ;
+ if (!*argv) dieusage() ;
if (wgola[GOLA_TIMEOUT])
{
if (!uint0_scan(wgola[GOLA_TIMEOUT], &timeout))
diff --git a/src/s6-frontend/process_status.c b/src/s6-frontend/process_status.c
index f9d05cf..d639cdc 100644
--- a/src/s6-frontend/process_status.c
+++ b/src/s6-frontend/process_status.c
@@ -90,7 +90,7 @@ void process_status (char const *const *argv)
int e = 0 ;
argv += gol_argv(argv, rgolb, 2, 0, 0, &wgolb, 0) ;
- if (!argv) dieusage() ;
+ if (!*argv) dieusage() ;
process_check_services(argv, env_len(argv)) ;
for (; *argv ; argv++)
{
diff --git a/src/s6-frontend/s6-frontend.c b/src/s6-frontend/s6-frontend.c
index 6933b57..8fe6428 100644
--- a/src/s6-frontend/s6-frontend.c
+++ b/src/s6-frontend/s6-frontend.c
@@ -67,8 +67,8 @@ void main_pretty_exec (char const *const *argv)
newargv[m++] = EXECLINE_EXTBINPREFIX "pipeline" ;
newargv[m++] = "--" ;
m += s6f_equote(newargv + m, argv, argc, 0, espace) ;
- newargv[m++] = " column" ;
- newargv[m++] = " -ts/" ;
+ newargv[m++] = "column" ;
+ newargv[m++] = "-ts/" ;
newargv[m++] = 0 ;
main_exec(newargv) ;
}