]> code.delx.au - pulseaudio/commitdiff
check for errors returned by pa_context_connect()
authorLennart Poettering <lennart@poettering.net>
Thu, 4 Sep 2008 23:31:39 +0000 (01:31 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 4 Sep 2008 23:31:39 +0000 (01:31 +0200)
src/utils/pacat.c

index 76aea36a2cffa543571651e67fc906453c06d379..99df5b9eb3370c3f2db4da25676947ac502629d7 100644 (file)
@@ -773,7 +773,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;
+    }
 
     if (verbose) {
         struct timeval tv;