summaryrefslogtreecommitdiffstats
path: root/src/shutdown
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2022-08-24 11:16:55 +0200
committerLennart Poettering <lennart@poettering.net>2022-08-31 22:53:18 +0200
commitc905aaf68607754a2aa131854544f5b44a378874 (patch)
tree4d421b84ed0571d7d97475c6ba8156015f40b722 /src/shutdown
parentumount: use structured initialization (diff)
downloadsystemd-c905aaf68607754a2aa131854544f5b44a378874.tar.xz
systemd-c905aaf68607754a2aa131854544f5b44a378874.zip
umount: minor modernizations
Diffstat (limited to 'src/shutdown')
-rw-r--r--src/shutdown/umount.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/shutdown/umount.c b/src/shutdown/umount.c
index 6d133d5761..2fd1b464e4 100644
--- a/src/shutdown/umount.c
+++ b/src/shutdown/umount.c
@@ -76,16 +76,15 @@ int mount_points_list_get(const char *mountinfo, MountPoint **head) {
return log_error_errno(r, "Failed to parse %s: %m", mountinfo ?: "/proc/self/mountinfo");
for (;;) {
+ _cleanup_free_ char *options = NULL, *remount_options = NULL;
struct libmnt_fs *fs;
const char *path, *fstype;
- _cleanup_free_ char *options = NULL;
unsigned long remount_flags = 0u;
- _cleanup_free_ char *remount_options = NULL;
bool try_remount_ro;
_cleanup_free_ MountPoint *m = NULL;
r = mnt_table_next_fs(table, iter, &fs);
- if (r == 1)
+ if (r == 1) /* EOF */
break;
if (r < 0)
return log_error_errno(r, "Failed to get next entry from %s: %m", mountinfo ?: "/proc/self/mountinfo");
@@ -197,7 +196,7 @@ int swap_list_get(const char *swaps, MountPoint **head) {
const char *source;
r = mnt_table_next_fs(t, i, &fs);
- if (r == 1)
+ if (r == 1) /* EOF */
break;
if (r < 0)
return log_error_errno(r, "Failed to get next entry from %s: %m", swaps ?: "/proc/swaps");