[pulseaudio-discuss] [PATCH] pasuspender: Check pa_context_connect() return value.

Tanu Kaskinen tanuk at iki.fi
Sat Dec 15 22:59:47 PST 2012


On Thu, 2012-03-29 at 12:18 +0300, Tanu Kaskinen wrote:
> ---
>  src/utils/pasuspender.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/src/utils/pasuspender.c b/src/utils/pasuspender.c
> index 0a60923..ac764d2 100644
> --- a/src/utils/pasuspender.c
> +++ b/src/utils/pasuspender.c
> @@ -292,7 +292,11 @@ int main(int argc, char *argv[]) {
>      }
>  
>      pa_context_set_state_callback(context, context_state_callback, NULL);
> -    pa_context_connect(context, server, PA_CONTEXT_NOAUTOSPAWN, NULL);
> +
> +    if (pa_context_connect(context, server, PA_CONTEXT_NOAUTOSPAWN, NULL) < 0) {
> +        fprintf(stderr, _("pa_context_connect() failed: %s\n"), pa_strerror(pa_context_errno(context)));
> +        goto quit;
> +    }
>  
>      if (pa_mainloop_run(m, &ret) < 0) {
>          fprintf(stderr, _("pa_mainloop_run() failed.\n"));

This is now applied.

-- 
Tanu



More information about the pulseaudio-discuss mailing list