mirror of
https://github.com/kdave/btrfs-progs
synced 2025-05-05 17:37:55 +00:00
btrfs-progs: use /proc/self/mounts
Signed-off-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>
This commit is contained in:
parent
d06b30feb9
commit
90cad5f9e6
@ -72,7 +72,7 @@ int find_mount_root(const char *path, char **mount_root)
|
|||||||
return -errno;
|
return -errno;
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
mnttab = fopen("/proc/mounts", "r");
|
mnttab = fopen("/proc/self/mounts", "r");
|
||||||
if (!mnttab)
|
if (!mnttab)
|
||||||
return -errno;
|
return -errno;
|
||||||
|
|
||||||
|
2
utils.c
2
utils.c
@ -997,7 +997,7 @@ int check_mounted_where(int fd, const char *file, char *where, int size,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* iterate over the list of currently mountes filesystems */
|
/* iterate over the list of currently mountes filesystems */
|
||||||
if ((f = setmntent ("/proc/mounts", "r")) == NULL)
|
if ((f = setmntent ("/proc/self/mounts", "r")) == NULL)
|
||||||
return -errno;
|
return -errno;
|
||||||
|
|
||||||
while ((mnt = getmntent (f)) != NULL) {
|
while ((mnt = getmntent (f)) != NULL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user