Use /proc/self/mountinfo to detect bind mounts
With /etc/mtab a symlink to /proc/self/mounts, bind mount information
can no longer be extracted from that file.
2011-03-31 Miloslav Trmač <mitr@redhat.com>
* src/bind-mount.c: Note that tmpwatch uses a related implementation.
* src/bind-mount.c (MOUNTINFO_PATH, struct mount, mount_entries)
(num_mount_entries, mount_data_obstack, mount_data_mark)
(mount_string_obstack, mount_string_mark, mount_list_obstack)
(mountinfo_line_obstack, init_mount_entries, read_mount_line)
(parse_mount_string, read_mount_entry, read_mount_entries): New
definitions, reading /proc/self/mountinfo.
(mountinfo_fd): New variable.
(last_path_mounted_mtime): Removed variable.
(add_bind_mount_path, cmp_ints, cmp_mount_entry_pointers)
(cmp_id_mount_entry): New functions.
(rebuild_bind_mount_paths, is_bind_mount, bind_mount_init): Use data
from /proc/self/mountinfo.