[PATCH] btrfs-progs: use mntent functions in find_mount_root

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: David Sterba <dsterba@xxxxxxx>
---
 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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux