David Sterba
2013-Nov-27 17:26 UTC
[PATCH] 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>
---
cmds-send.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cmds-send.c b/cmds-send.c
index 43ea06b5c23f..3d2171518db8 100644
--- a/cmds-send.c
+++ b/cmds-send.c
@@ -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,
--
1.8.4.3
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs"
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html