* Solaris defines hasmntop with a char * instead of const char *
  second argument. Passing the constant string "ignore" generates a
  compiler warning. Define MNT_IGNORE correctly in both cases to avoid
  the warning.

Signed-off-by: Ben Walton <bdwal...@gmail.com>
---
 lib/mountlist.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lib/mountlist.c b/lib/mountlist.c
index 78af951..201d918 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
-- 
1.9.1


Reply via email to