summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarc-André Lureau <marc-andre.lureau@nokia.com>2009-02-17 20:27:45 +0200
committerLennart Poettering <lennart@poettering.net>2009-02-19 04:53:20 +0100
commit2aeab75c6893c882800975866178c79dfe85202a (patch)
tree4171db3f2c56cc46374c8a0e2d569af4ffab5070 /src
parent6c8d851643a8413678c7557abc9758cc1bee94c0 (diff)
paplay: check if pa_context_connect() succeed
Diffstat (limited to 'src')
-rw-r--r--src/utils/paplay.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/utils/paplay.c b/src/utils/paplay.c
index df2edf62..dec80e5c 100644
--- a/src/utils/paplay.c
+++ b/src/utils/paplay.c
@@ -400,7 +400,10 @@ int main(int argc, char *argv[]) {
pa_context_set_state_callback(context, context_state_callback, NULL);
/* Connect the context */
- 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;
+ }
/* Run the main loop */
if (pa_mainloop_run(m, &ret) < 0) {