From aa85de4be3f96a140a69170330293bfdfa3d24e7 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Thu, 15 May 2014 00:15:52 -0700 Subject: contrib: Cross platform fixes after recent commits - provide a getment_r () version which behaves as re-entrant with some caveats for NetBSD/OSX specific. - some apparent warning issues fixed, always use PRI* format specification avoid using %ld i.e not portable Change-Id: Ib3d1a73b426e38b436b356355b97db0104a1a4a5 BUG: 1089172 Signed-off-by: Harshavardhana Reviewed-on: http://review.gluster.org/7722 Reviewed-by: Emmanuel Dreyfus Tested-by: Gluster Build System Reviewed-by: Anand Avati --- contrib/mount/mntent_compat.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'contrib/mount/mntent_compat.h') diff --git a/contrib/mount/mntent_compat.h b/contrib/mount/mntent_compat.h index 76a75754b1c..3f9cc931266 100644 --- a/contrib/mount/mntent_compat.h +++ b/contrib/mount/mntent_compat.h @@ -11,7 +11,7 @@ #ifndef _MNTENT_H #define _MNTENT_H -#ifdef GF_DARWIN_HOST_OS +#if defined(GF_DARWIN_HOST_OS) || defined(__NetBSD__) #include struct mntent { @@ -24,6 +24,8 @@ struct mntent { }; struct mntent *getmntent (FILE *fp); +struct mntent *getmntent_r (FILE *fp, struct mntent *result, + char *buffer, int bufsize); FILE *setmntent (const char *filename, const char *type); int endmntent(FILE *fp); char * hasmntopt (const struct mntent *mnt, const char *option); @@ -31,5 +33,5 @@ char * hasmntopt (const struct mntent *mnt, const char *option); /* Dummy - /etc/mtab has no meaning on OSX platform */ #define _PATH_MOUNTED "/etc/mtab" -#endif /* GF_DARWIN_HOST_OS */ +#endif /* GF_DARWIN_HOST_OS || __NetBSD__ */ #endif /* _MNTENT_H */ -- cgit