bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] mountlist: ensure hasmntopt's opt argument is passed with correc


From: Ben Walton
Subject: [PATCH] mountlist: ensure hasmntopt's opt argument is passed with correct type
Date: Tue, 3 Jun 2014 23:01:14 +0100

* 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 <address@hidden>
---
 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

[Prev in Thread] Current Thread [Next in Thread]