diff options
author | Ben Walton <bdwalton@gmail.com> | 2014-06-03 23:01:14 +0100 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2014-06-06 02:15:32 +0100 |
commit | 502809019bd2ca3ce3d041d18c35ce9420eedb72 (patch) | |
tree | 84dd21c41adf061dd6287a4aeff533e469d7913b /lib/mountlist.c | |
parent | d55899fd2c5794ac85ecb14d5e2f646a89e4b4dd (diff) | |
download | gnulib-502809019bd2ca3ce3d041d18c35ce9420eedb72.tar.gz |
mountlist: avoid hasmntopt const type warning on solaris
* lib/mountlist.c: Solaris defines the OPT param of hasmntopt()
with char * instead of const char *. Passing the constant string
"ignore" generates a compiler warning. For Solaris cast MNT_IGNORE
to avoid the warning.
Signed-off-by: Ben Walton <bdwalton@gmail.com>
Diffstat (limited to 'lib/mountlist.c')
-rw-r--r-- | lib/mountlist.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/mountlist.c b/lib/mountlist.c index 78af951818..b3be011a1b 100644 --- a/lib/mountlist.c +++ b/lib/mountlist.c @@ -134,7 +134,13 @@ #undef MNT_IGNORE #ifdef MNTOPT_IGNORE -# define MNT_IGNORE(M) hasmntopt (M, MNTOPT_IGNORE) +# if defined __sun && defined __SVR4 +/* Solaris defines hasmntopt(struct mnttab *, char *) + while it is otherwise hasmntopt(struct mnttab *, const char *). */ +# define MNT_IGNORE(M) hasmntopt (M, (char *) MNTOPT_IGNORE) +# else +# define MNT_IGNORE(M) hasmntopt (M, MNTOPT_IGNORE) +# endif #else # define MNT_IGNORE(M) 0 #endif |