diff options
author | Harshavardhana <harsha@harshavardhana.net> | 2014-05-15 00:15:52 -0700 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2014-05-17 11:52:53 -0700 |
commit | aa85de4be3f96a140a69170330293bfdfa3d24e7 (patch) | |
tree | 8ae6a10aa4b850492aa3cd109db5150e63aa9667 /contrib/mount/mntent_compat.h | |
parent | f4a391e5a44950b0468af082255b9f5abf52b10b (diff) |
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 <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/7722
Reviewed-by: Emmanuel Dreyfus <manu@netbsd.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'contrib/mount/mntent_compat.h')
-rw-r--r-- | contrib/mount/mntent_compat.h | 6 |
1 files changed, 4 insertions, 2 deletions
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 <stdio.h> 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 */ |