From 387d5f32347e426214389e0251a1240e076d250d Mon Sep 17 00:00:00 2001 From: David Sterba Date: Wed, 27 Nov 2013 18:22:34 +0100 Subject: [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 Signed-off-by: Chris Mason --- cmds-send.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmds-send.c b/cmds-send.c index 43ea06b..3d21715 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, -- 2.7.4