]> Savannah Git Hosting - gnulib.git/commitdiff
mountlist: avoid hasmntopt const type warning on solaris
authorBen Walton <bdwalton@gmail.com>
Tue, 3 Jun 2014 22:01:14 +0000 (23:01 +0100)
committerPádraig Brady <P@draigBrady.com>
Fri, 6 Jun 2014 01:15:32 +0000 (02:15 +0100)
* 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>
ChangeLog
lib/mountlist.c

index 97da78d035f30f7d1b523fa1e88317e175f0ed94..5364627462ee0ca189759eeffd730744acf99f70 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2014-06-06  Ben Walton  <bdwalton@gmail.com>
+
+       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.
+
 2014-06-04  Eric Blake  <eblake@redhat.com>
 
        maintainer-makefile: delete obsolete code
index 78af951818e251a96443c3f963d31fa4eaab4942..b3be011a1b3b6eb8ed75179d63152401fd48d1a6 100644 (file)
 
 #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