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

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

 



On 03/29/2012 11:18 AM, 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)));

You probably do the i18n for consistency with what's three lines below, 
but I'd like strings like these to remain untranslated (they are 
unlikely to be helpful for non-English speaking users).

Or if you insist on translating them, we should at least create a 
generic "%s failed: %s\n" string and use everywhere.

-- 
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic


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

  Powered by Linux