1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-31 16:21:26 +03:00

MountImages: fix exec_context_dump printf

Use strempty as options might not be set, and add the separator
for each option tuple
This commit is contained in:
Luca Boccassi 2021-02-22 10:12:34 +00:00 committed by Yu Watanabe
parent 518339d89f
commit 79e20ceb59

View File

@ -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");
}
}