aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2020-12-02 09:56:12 +0200
committerSergey Poznyakoff <gray@gnu.org>2020-12-02 09:56:12 +0200
commit354db96f3bb277341ae4bf8b647d3fd606da7e1f (patch)
tree1a314f069640bef9de4869c19081518a72102f84 /src
parent69431c377e35378306c1d6e87412af32d4b2a4a1 (diff)
downloadpies-354db96f3bb277341ae4bf8b647d3fd606da7e1f.tar.gz
pies-354db96f3bb277341ae4bf8b647d3fd606da7e1f.tar.bz2
Improve documentation
* doc/pies.texi: Improve documentation of variable expansion and the use of pies in docker entry points. * src/pies.h (vlogmsg): New proto. * src/progman.c (prog_start_prologue): Set ws_error member to ensure errors from ${X:?WORD} construct are properly reported.
Diffstat (limited to 'src')
-rw-r--r--src/pies.h1
-rw-r--r--src/progman.c13
2 files changed, 13 insertions, 1 deletions
diff --git a/src/pies.h b/src/pies.h
index ffccecd..f2aa5ef 100644
--- a/src/pies.h
+++ b/src/pies.h
@@ -522,6 +522,7 @@ void diag_setup (int flags);
void diagmsg (int logf, int prio, const char *fmt, ...)
PIES_PRINTFLIKE(3,4);
+void vlogmsg (int prio, const char *fmt, va_list ap);
void logmsg (int prio, const char *fmt, ...) PIES_PRINTFLIKE(2,3);
void logmsg_printf (int prio, const char *fmt, ...) PIES_PRINTFLIKE(2,3);
void logmsg_vprintf (int prio, const char *fmt, va_list ap);
diff --git a/src/progman.c b/src/progman.c
index 1cd5f9d..22482ae 100644
--- a/src/progman.c
+++ b/src/progman.c
@@ -808,6 +808,16 @@ prog_open_socket (struct prog *prog)
}
static void
+progman_ws_error (const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start (ap, fmt);
+ vlogmsg (LOG_ERR, fmt, ap);
+ va_end (ap);
+}
+
+static void
prog_start_prologue (struct prog *prog)
{
if (prog->v.p.comp->dir)
@@ -848,8 +858,9 @@ prog_start_prologue (struct prog *prog)
size_t argc;
ws.ws_env = (const char **) environ_ptr (prog->v.p.env);
+ ws.ws_error = progman_ws_error;
if (wordsplit (prog->v.p.comp->command, &ws,
- WRDSF_QUOTE | WRDSF_SQUEEZE_DELIMS | WRDSF_NOCMD | WRDSF_ENV))
+ WRDSF_QUOTE | WRDSF_SQUEEZE_DELIMS | WRDSF_NOCMD | WRDSF_ENV | WRDSF_ERROR))
{
logmsg (LOG_ERR, _("%s: can't split command line: %s"),
prog_tag (prog), wordsplit_strerror (&ws));

Return to:

Send suggestions and report system problems to the System administrator.