btrfs-progs: use mntent functions in find_mount_root

getmntent should be used in context of *mntent functions, though
fopen/fclose works.

Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
master
David Sterba 2013-11-27 18:22:34 +01:00 committed by Chris Mason
parent 37cd29521a
commit 387d5f3234
1 changed files with 2 additions and 2 deletions

View File

@ -72,7 +72,7 @@ int find_mount_root(const char *path, char **mount_root)
return -errno;
close(fd);
mnttab = fopen("/proc/self/mounts", "r");
mnttab = setmntent("/proc/self/mounts", "r");
if (!mnttab)
return -errno;
@ -87,7 +87,7 @@ int find_mount_root(const char *path, char **mount_root)
}
}
}
fclose(mnttab);
endmntent(mnttab);
if (!longest_match) {
fprintf(stderr,