summaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/pacat.c3
-rw-r--r--src/utils/pactl.c6
-rw-r--r--src/utils/padsp.c4
-rw-r--r--src/utils/paplay.c5
4 files changed, 12 insertions, 6 deletions
diff --git a/src/utils/pacat.c b/src/utils/pacat.c
index 10015ce4..2224da9a 100644
--- a/src/utils/pacat.c
+++ b/src/utils/pacat.c
@@ -336,7 +336,6 @@ static void context_drain_complete(pa_context*c, void *userdata) {
/* Stream draining complete */
static void stream_drain_complete(pa_stream*s, int success, void *userdata) {
- pa_operation *o;
if (!success) {
fprintf(stderr, _("Failed to drain stream: %s\n"), pa_strerror(pa_context_errno(context)));
@@ -350,7 +349,7 @@ static void stream_drain_complete(pa_stream*s, int success, void *userdata) {
pa_stream_unref(stream);
stream = NULL;
- if (!(o = pa_context_drain(context, context_drain_complete, NULL)))
+ if (!pa_context_drain(context, context_drain_complete, NULL))
pa_context_disconnect(context);
else {
if (verbose)
diff --git a/src/utils/pactl.c b/src/utils/pactl.c
index 154e7f9c..d3da90e6 100644
--- a/src/utils/pactl.c
+++ b/src/utils/pactl.c
@@ -649,6 +649,7 @@ static void stream_write_callback(pa_stream *s, size_t length, void *userdata) {
pa_xfree(d);
fprintf(stderr, _("Premature end of file\n"));
quit(1);
+ return;
}
pa_stream_write(s, d, length, pa_xfree, 0, PA_SEEK_RELATIVE);
@@ -1029,7 +1030,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"));
diff --git a/src/utils/padsp.c b/src/utils/padsp.c
index 046bae45..76e86c8d 100644
--- a/src/utils/padsp.c
+++ b/src/utils/padsp.c
@@ -1202,7 +1202,7 @@ fail:
static void sink_info_cb(pa_context *context, const pa_sink_info *si, int eol, void *userdata) {
fd_info *i = userdata;
- if (!si && eol < 0) {
+ if (!si || eol < 0) {
i->operation_success = 0;
pa_threaded_mainloop_signal(i->mainloop, 0);
return;
@@ -1224,7 +1224,7 @@ static void sink_info_cb(pa_context *context, const pa_sink_info *si, int eol, v
static void source_info_cb(pa_context *context, const pa_source_info *si, int eol, void *userdata) {
fd_info *i = userdata;
- if (!si && eol < 0) {
+ if (!si || eol < 0) {
i->operation_success = 0;
pa_threaded_mainloop_signal(i->mainloop, 0);
return;
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) {