From 9aa47f9768fe2efd9f2cf89d8819a8582363324f Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Thu, 31 Aug 2023 17:08:21 +0100 Subject: [PATCH] Quote path value in --filemap debug messages Improves readability of debugging output when file paths contain whitespace. --- libdm/dm-tools/dmfilemapd.c | 2 +- libdm/libdm-stats.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libdm/dm-tools/dmfilemapd.c b/libdm/dm-tools/dmfilemapd.c index f6c04e03e..832722a70 100644 --- a/libdm/dm-tools/dmfilemapd.c +++ b/libdm/dm-tools/dmfilemapd.c @@ -826,7 +826,7 @@ int main(int argc, char **argv) _setup_logging(); log_info("Starting dmfilemapd with fd=%d, group_id=" FMTu64 " " - "mode=%s, path=%s", fm.fd, fm.group_id, + "mode=%s, path=\"%s\"", fm.fd, fm.group_id, _mode_names[fm.mode], fm.path); if (!_foreground && !_daemonise(&fm)) { diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c index bf2f0ee88..6f05c01e3 100644 --- a/libdm/libdm-stats.c +++ b/libdm/libdm-stats.c @@ -5116,7 +5116,7 @@ int dm_stats_start_filemapd(int fd, uint64_t group_id, const char *path, /* terminate args[argc] */ args[argc] = NULL; - log_very_verbose("Spawning daemon as '%s %d " FMTu64 " %s %s %u %u'", + log_very_verbose("Spawning daemon as '%s %d " FMTu64 " \"%s\" %s %u %u'", *args, fd, group_id, path, mode_str, foreground, verbose);