audiod: Improve status timeout handling.
[paraslash.git] / audiod.c
index 91f6e1e6a474f165870bb4bbe615dccad4fcffbf..dcf2c14738d3336bcce19dbc9a2fcd565dcded7a 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -1228,14 +1228,15 @@ static int status_post_select(struct sched *s, struct task *t)
                char *buf;
                size_t sz;
                int ret;
-               if (st->ct->task.error < 0) {
+
+               ret = btr_node_status(st->btrn, st->min_iqs, BTR_NT_LEAF);
+               if (ret < 0) {
                        close_stat_pipe();
                        goto out;
                }
                if (st->ct->status != CL_EXECUTING)
                        goto out;
-               ret = btr_node_status(st->btrn, st->min_iqs, BTR_NT_LEAF);
-               if (ret <= 0) {
+               if (ret == 0) {
                        struct timeval diff;
                        tv_diff(now, &st->last_status_read, &diff);
                        if (diff.tv_sec > 61)