summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2019-12-23 11:48:48 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2019-12-23 11:48:48 +0000
commit8bbfc319248c0cbeb57edc45f26d1c972d32f505 (patch)
tree593057b04a6d8531a5d881fd892bced6f8354389 /src
parent76c5586ea0b3b98ae42f2000c94c04297391f1af (diff)
downloads6-8bbfc319248c0cbeb57edc45f26d1c972d32f505.tar.xz
Add ?processor support to s6-log
Diffstat (limited to 'src')
-rw-r--r--src/daemontools-extras/s6-log.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/daemontools-extras/s6-log.c b/src/daemontools-extras/s6-log.c
index 8596879..6b2035e 100644
--- a/src/daemontools-extras/s6-log.c
+++ b/src/daemontools-extras/s6-log.c
@@ -304,7 +304,7 @@ static int finish (logdir_t *ldp, char const *name, char suffix)
static inline void exec_processor (logdir_t *ldp)
{
- char const *cargv[4] = { EXECLINE_EXTBINPREFIX "execlineb", "-Pc", ldp->processor, 0 } ;
+ char const *cargv[4] = { ldp->flags & 4 ? "/bin/sh" : EXECLINE_EXTBINPREFIX "execlineb", ldp->flags & 4 ? "-c" : "-Pc", ldp->processor, 0 } ;
int fd ;
PROG = "s6-log (processor child)" ;
if (chdir(ldp->dir) < 0) strerr_diefu2sys(111, "chdir to ", ldp->dir) ;
@@ -714,6 +714,7 @@ static inline void script_firstpass (char const *const *argv, unsigned int *sell
case 'E' :
case '^' :
case '!' :
+ case '?' :
break ;
case 't' :
if ((*argv)[1]) goto fail ;
@@ -839,6 +840,11 @@ static inline void script_secondpass (char const *const *argv, scriptelem_t *scr
break ;
case '!' :
processor = (*argv)[1] ? *argv + 1 : 0 ;
+ flags &= ~4 ;
+ break ;
+ case '?' :
+ processor = (*argv)[1] ? *argv + 1 : 0 ;
+ flags |= 4 ;
break ;
case 't' :
flags |= 1 ;