linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: use mntent functions in find_mount_root
@ 2013-11-27 17:26 David Sterba
  0 siblings, 0 replies; only message in thread
From: David Sterba @ 2013-11-27 17:26 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-11-27 17:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-27 17:26 [PATCH] btrfs-progs: use mntent functions in find_mount_root David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).