From f795267e3ad419c1f40dec0d3aef77cb8db3b841 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 15 Nov 2019 14:56:35 +0100 Subject: shutdown: make logging more useful if NULL swap/mount table files are specified Makes the error output seen in #13993 more readable. --- src/shutdown/umount.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/shutdown/umount.c b/src/shutdown/umount.c index 4563a9d720..4a96e1b794 100644 --- a/src/shutdown/umount.c +++ b/src/shutdown/umount.c @@ -62,7 +62,7 @@ int mount_points_list_get(const char *mountinfo, MountPoint **head) { r = libmount_parse(mountinfo, NULL, &table, &iter); if (r < 0) - return log_error_errno(r, "Failed to parse %s: %m", mountinfo); + return log_error_errno(r, "Failed to parse %s: %m", mountinfo ?: "/proc/self/mountinfo"); for (;;) { struct libmnt_fs *fs; @@ -77,7 +77,7 @@ int mount_points_list_get(const char *mountinfo, MountPoint **head) { if (r == 1) break; if (r < 0) - return log_error_errno(r, "Failed to get next entry from %s: %m", mountinfo); + return log_error_errno(r, "Failed to get next entry from %s: %m", mountinfo ?: "/proc/self/mountinfo"); path = mnt_fs_get_target(fs); if (!path) @@ -185,7 +185,7 @@ int swap_list_get(const char *swaps, MountPoint **head) { r = mnt_table_parse_swaps(t, swaps); if (r < 0) - return log_error_errno(r, "Failed to parse %s: %m", swaps); + return log_error_errno(r, "Failed to parse %s: %m", swaps ?: "/proc/swaps"); for (;;) { struct libmnt_fs *fs; @@ -196,7 +196,7 @@ int swap_list_get(const char *swaps, MountPoint **head) { if (r == 1) break; if (r < 0) - return log_error_errno(r, "Failed to get next entry from %s: %m", swaps); + return log_error_errno(r, "Failed to get next entry from %s: %m", swaps ?: "/proc/swaps"); source = mnt_fs_get_source(fs); if (!source) -- cgit v1.2.3