]> git.proxmox.com Git - mirror_lxc.git/commitdiff
Include all lxcmntent.h function declarations on Bionic
authorPreetam D'Souza <preetamjdsouza@gmail.com>
Tue, 28 Jun 2016 03:12:12 +0000 (23:12 -0400)
committerPreetam D'Souza <preetamjdsouza@gmail.com>
Tue, 28 Jun 2016 16:52:06 +0000 (16:52 +0000)
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@gmail.com>
src/include/lxcmntent.h

index bf731a0557eccd80358726d9019a94dd26aa029f..25df5b96fd510437c7e3e40b6c196fba83a2ec85 100644 (file)
@@ -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