shutdown: use libmount to enumerate /proc/self/mountinfo
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 14 Mar 2018 10:32:30 +0000 (11:32 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 16 Mar 2018 09:09:46 +0000 (10:09 +0100)
commit95b862b0540ac24999fdfbd670e8744bb626729a
tree94a627853bf4030552a3fe2991f51539d84f7489
parentb93618644bf24bc0cd87adb1346955d783f6f9b8
shutdown: use libmount to enumerate /proc/self/mountinfo

This is analogous to 8d3ae2bd4c9bf9fc2e57f7b3776325a1c750ca30, except that now
src/core/umount.c not src/core/mount.c is converted.

Might help with https://bugzilla.redhat.com/show_bug.cgi?id=1554943, or not.

In the patch, mnt_free_tablep and mnt_free_iterp are declared twice. It'd
be nicer to define them just once in mount-setup.h, but then libmount.h would
have to be included there. libmount.h seems to be buggy, and declares some
defines which break other headers, and working around this is more pain than
the two duplicate lines. So let's live with the duplication for now.

This fixes memleak of MountPoint in mount_points_list_get() on error, not that
it matters any.
meson.build
src/core/mount.c
src/core/umount.c