Commit 155543d9 by Preetam D'Souza Committed by Stéphane Graber

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: 's avatarPreetam D'Souza <preetamjdsouza@gmail.com>
parent 9179d21a
...@@ -36,15 +36,15 @@ extern struct mntent *getmntent (FILE *stream); ...@@ -36,15 +36,15 @@ extern struct mntent *getmntent (FILE *stream);
extern struct mntent *getmntent_r (FILE *stream, struct mntent *mp, char *buffer, int bufsiz); extern struct mntent *getmntent_r (FILE *stream, struct mntent *mp, char *buffer, int bufsiz);
#endif #endif
#ifndef HAVE_SETMNTENT #if !defined(HAVE_SETMNTENT) || IS_BIONIC
FILE *setmntent (const char *file, const char *mode); FILE *setmntent (const char *file, const char *mode);
#endif #endif
#ifndef HAVE_ENDMNTENT #if !defined(HAVE_ENDMNTENT) || IS_BIONIC
int endmntent (FILE *stream); int endmntent (FILE *stream);
#endif #endif
#ifndef HAVE_HASMNTOPT #if !defined(HAVE_HASMNTOPT) || IS_BIONIC
extern char *hasmntopt (const struct mntent *mnt, const char *opt); extern char *hasmntopt (const struct mntent *mnt, const char *opt);
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment