shutdown: make logging more useful if NULL swap/mount table files are specified

Makes the error output seen in #13993 more readable.
This commit is contained in:
Lennart Poettering
2019-11-15 14:56:35 +01:00
parent 7be830c6e8
commit f795267e3a
+4 -4
View File
@@ -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)