btrfs-progs: use /proc/self/mounts
authorAnand Jain <anand.jain@oracle.com>
Thu, 7 Nov 2013 02:53:43 +0000 (10:53 +0800)
committerChris Mason <clm@fb.com>
Fri, 31 Jan 2014 16:22:01 +0000 (08:22 -0800)
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>
cmds-send.c
utils.c

index 53e9a53..43ea06b 100644 (file)
@@ -72,7 +72,7 @@ int find_mount_root(const char *path, char **mount_root)
                return -errno;
        close(fd);
 
-       mnttab = fopen("/proc/mounts", "r");
+       mnttab = fopen("/proc/self/mounts", "r");
        if (!mnttab)
                return -errno;
 
diff --git a/utils.c b/utils.c
index 81cae6d..3c9701d 100644 (file)
--- a/utils.c
+++ b/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 */
-       if ((f = setmntent ("/proc/mounts", "r")) == NULL)
+       if ((f = setmntent ("/proc/self/mounts", "r")) == NULL)
                return -errno;
 
        while ((mnt = getmntent (f)) != NULL) {