[lxc-devel] [lxc/master] Include all lxcmntent.h function declarations on Bionic
pdsouza on Github
lxc-bot at linuxcontainers.org
Tue Jun 28 16:58:44 UTC 2016
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 901 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160628/f6ffea85/attachment.bin>
-------------- next part --------------
From 702f5a1c640244829f2f5f20f6ab821e86a8858c Mon Sep 17 00:00:00 2001
From: Preetam D'Souza <preetamjdsouza at gmail.com>
Date: Mon, 27 Jun 2016 23:12:12 -0400
Subject: [PATCH] Include all lxcmntent.h function declarations on Bionic
Newer versions of Android (5.0+, aka API Level 21+) include mntent.h,
which declares setmntent and endmntent. This hits an edge
case with the preprocessor checks in lxcmntent.h because HAVE_SETMNTENT
and HAVE_ENDMNTENT are both defined (in Bionic's mntent.h), but conf.c
always includes lxcmntent.h on Bionic! As a result, we get compiler
warnings of implicit function declarations for setmntent endmntent.
This patch always includes setmntent/endmntent/hasmntopt function
declarations on Bionic, which gets rid of these warnings.
Signed-off-by: Preetam D'Souza <preetamjdsouza at gmail.com>
---
src/include/lxcmntent.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/include/lxcmntent.h b/src/include/lxcmntent.h
index bf731a0..25df5b9 100644
--- a/src/include/lxcmntent.h
+++ b/src/include/lxcmntent.h
@@ -36,15 +36,15 @@ extern struct mntent *getmntent (FILE *stream);
extern struct mntent *getmntent_r (FILE *stream, struct mntent *mp, char *buffer, int bufsiz);
#endif
-#ifndef HAVE_SETMNTENT
+#if !defined(HAVE_SETMNTENT) || IS_BIONIC
FILE *setmntent (const char *file, const char *mode);
#endif
-#ifndef HAVE_ENDMNTENT
+#if !defined(HAVE_ENDMNTENT) || IS_BIONIC
int endmntent (FILE *stream);
#endif
-#ifndef HAVE_HASMNTOPT
+#if !defined(HAVE_HASMNTOPT) || IS_BIONIC
extern char *hasmntopt (const struct mntent *mnt, const char *opt);
#endif
More information about the lxc-devel
mailing list