From 8bbfc319248c0cbeb57edc45f26d1c972d32f505 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 23 Dec 2019 11:48:48 +0000 Subject: Add ?processor support to s6-log --- src/daemontools-extras/s6-log.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/daemontools-extras/s6-log.c') 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 ; -- cgit v1.2.3