From: Luca Boccassi Date: Mon, 22 Feb 2021 10:12:34 +0000 (+0000) Subject: MountImages: fix exec_context_dump printf X-Git-Tag: v248-rc1~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=79e20ceb59157662eb32fdf3a7eb1e4d9d8bf00b;p=thirdparty%2Fsystemd.git MountImages: fix exec_context_dump printf Use strempty as options might not be set, and add the separator for each option tuple --- diff --git a/src/core/execute.c b/src/core/execute.c index d14aec47d0e..d27adbbba54 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -5648,15 +5648,14 @@ void exec_context_dump(const ExecContext *c, FILE* f, const char *prefix) { for (size_t i = 0; i < c->n_mount_images; i++) { MountOptions *o; - fprintf(f, "%sMountImages: %s%s:%s%s", prefix, + fprintf(f, "%sMountImages: %s%s:%s", prefix, c->mount_images[i].ignore_enoent ? "-": "", c->mount_images[i].source, - c->mount_images[i].destination, - LIST_IS_EMPTY(c->mount_images[i].mount_options) ? "": ":"); + c->mount_images[i].destination); LIST_FOREACH(mount_options, o, c->mount_images[i].mount_options) - fprintf(f, "%s:%s", + fprintf(f, ":%s:%s", partition_designator_to_string(o->partition_designator), - o->options); + strempty(o->options)); fprintf(f, "\n"); } }