summaryrefslogtreecommitdiff
path: root/src/shutdown
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-04-30 19:44:17 +0200
committerGitHub <noreply@github.com>2019-04-30 19:44:17 +0200
commitadb7b782f83ca076b09b60a905f9ffb311835693 (patch)
tree048032608f772a273f4177b866c49e0448a97fe5 /src/shutdown
parent9f3f596477ba68d4ece645536586756caea4ae97 (diff)
parent2f2d81d957b2d5ef7a0f8a702dcf7f71348cffe3 (diff)
downloadsystemd-adb7b782f83ca076b09b60a905f9ffb311835693.tar.gz
Merge pull request #12218 from keszybz/use-libmount-more
Use libmount more
Diffstat (limited to 'src/shutdown')
-rw-r--r--src/shutdown/umount.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/shutdown/umount.c b/src/shutdown/umount.c
index e30b475c75..c75be39fef 100644
--- a/src/shutdown/umount.c
+++ b/src/shutdown/umount.c
@@ -55,18 +55,13 @@ void mount_points_list_free(MountPoint **head) {
}
int mount_points_list_get(const char *mountinfo, MountPoint **head) {
- _cleanup_(mnt_free_tablep) struct libmnt_table *t = NULL;
- _cleanup_(mnt_free_iterp) struct libmnt_iter *i = NULL;
+ _cleanup_(mnt_free_tablep) struct libmnt_table *table = NULL;
+ _cleanup_(mnt_free_iterp) struct libmnt_iter *iter = NULL;
int r;
assert(head);
- t = mnt_new_table();
- i = mnt_new_iter(MNT_ITER_FORWARD);
- if (!t || !i)
- return log_oom();
-
- r = mnt_table_parse_mtab(t, mountinfo);
+ r = libmount_parse(mountinfo, NULL, &table, &iter);
if (r < 0)
return log_error_errno(r, "Failed to parse %s: %m", mountinfo);
@@ -79,7 +74,7 @@ int mount_points_list_get(const char *mountinfo, MountPoint **head) {
bool try_remount_ro;
_cleanup_free_ MountPoint *m = NULL;
- r = mnt_table_next_fs(t, i, &fs);
+ r = mnt_table_next_fs(table, iter, &fs);
if (r == 1)
break;
if (r < 0)