[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] mountlist: ensure hasmntopt's opt argument is passed with co
From: |
Pádraig Brady |
Subject: |
Re: [PATCH] mountlist: ensure hasmntopt's opt argument is passed with correct type |
Date: |
Fri, 06 Jun 2014 02:17:24 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 |
On 06/03/2014 11:01 PM, Ben Walton wrote:
> * 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
>
Pushed with a few tweaks.
thanks,
Pádraig.