summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Behrens <sbehrens@giantdisaster.de>2013-03-25 15:21:42 +0100
committerDavid Sterba <dsterba@suse.cz>2013-04-09 18:43:32 +0200
commitf592cd1cc05868caa477689ca7caabaa202d08a4 (patch)
tree6ba5f87c3eff414fd79c0234f20aff55ae6993e8
parent08fecd7658610d8572b04280d6708960a3265a88 (diff)
Btrfs-progs: Use /proc/mounts instead of /etc/mtab
/etc/mtab is not working correctly in situations where multiple mount namespaces are used. Use /proc/mounts instead like the rest of the code is doing it. Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
-rw-r--r--cmds-send.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmds-send.c b/cmds-send.c
index b2a340e0..5a7183d0 100644
--- a/cmds-send.c
+++ b/cmds-send.c
@@ -70,7 +70,7 @@ int find_mount_root(const char *path, char **mount_root)
return -errno;
close(fd);
- mnttab = fopen("/etc/mtab", "r");
+ mnttab = fopen("/proc/mounts", "r");
while ((ent = getmntent(mnttab))) {
len = strlen(ent->mnt_dir);
if (strncmp(ent->mnt_dir, path, len) == 0) {