From 93ed27d5617202441bd9be346ce916289fe7128d Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Tue, 17 Feb 2009 20:31:06 +0200 Subject: pactl: check if pa_context_connect succeed --- src/utils/pactl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/utils/pactl.c') diff --git a/src/utils/pactl.c b/src/utils/pactl.c index 154e7f9c..e020f372 100644 --- a/src/utils/pactl.c +++ b/src/utils/pactl.c @@ -1029,7 +1029,10 @@ int main(int argc, char *argv[]) { } pa_context_set_state_callback(context, context_state_callback, NULL); - pa_context_connect(context, server, 0, NULL); + if (pa_context_connect(context, server, 0, NULL) < 0) { + fprintf(stderr, _("pa_context_connect() failed: %s"), pa_strerror(pa_context_errno(context))); + goto quit; + } if (pa_mainloop_run(m, &ret) < 0) { fprintf(stderr, _("pa_mainloop_run() failed.\n")); -- cgit