From: David Sterba <dsterba@suse.cz>
To: linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.cz>
Subject: [PATCH] btrfs-progs: use mntent functions in find_mount_root
Date: Wed, 27 Nov 2013 18:26:34 +0100 [thread overview]
Message-ID: <1385573194-3800-1-git-send-email-dsterba@suse.cz> (raw)
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
reply other threads:[~2013-11-27 17:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1385573194-3800-1-git-send-email-dsterba@suse.cz \
--to=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).