[PATCH 6/8] core: Document behaviour of pa_shared_remove() in case name does not exist

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

 



On 08.03.2017 16:09, Peter Meerwald-Stadler wrote:
> ignore pa_shared_remove() return value
> Coverity ID: #1380672

I think the commit title and commit message should be swapped,
because the real reason for the patch is to silence a warning about
the unused return value.

>
> Signed-off-by: Peter Meerwald-Stadler <pmeerw at pmeerw.net>
> ---
>   src/pulsecore/shared.c | 2 +-
>   src/pulsecore/shared.h | 4 +++-
>   2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/pulsecore/shared.c b/src/pulsecore/shared.c
> index 1b5eea9..9bc7eb5 100644
> --- a/src/pulsecore/shared.c
> +++ b/src/pulsecore/shared.c
> @@ -111,6 +111,6 @@ int pa_shared_replace(pa_core *c, const char *name, void *data) {
>       pa_assert(c);
>       pa_assert(name);
>   
> -    pa_shared_remove(c, name);
> +    (void) pa_shared_remove(c, name);
>       return pa_shared_set(c, name, data);
>   }
> diff --git a/src/pulsecore/shared.h b/src/pulsecore/shared.h
> index 49e8738..19ac462 100644
> --- a/src/pulsecore/shared.h
> +++ b/src/pulsecore/shared.h
> @@ -44,7 +44,9 @@ int pa_shared_set(pa_core *c, const char *name, void *data);
>   /* Remove the specified shared property. Return non-zero on failure */
>   int pa_shared_remove(pa_core *c, const char *name);
>   
> -/* A combination of pa_shared_remove() and pa_shared_set() */
> +/* A combination of pa_shared_remove() and pa_shared_set(); this function
> + * first tries to remove the property by this name and then sets the
> + * property. Return non-zero on failure. */
>   int pa_shared_replace(pa_core *c, const char *name, void *data);
>   
>   /* Dump the current set of shared properties */




[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux