]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - audiod.c
Remove ->signum from struct signal_task.
[paraslash.git] / audiod.c
index cc4164fead07425382e539f90261dead037c6279..99b4c7df78ddfe2b48058726a5a3acc9ca18fd61 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -983,16 +983,17 @@ static void signal_pre_select(struct sched *s, struct task *t)
 static void signal_post_select(struct sched *s, struct task *t)
 {
        struct signal_task *st = container_of(t, struct signal_task, task);
+       int signum;
 
        if (!FD_ISSET(st->fd, &s->rfds))
                return;
 
-       st->signum = para_next_signal();
-       switch (st->signum) {
+       signum = para_next_signal();
+       switch (signum) {
        case SIGINT:
        case SIGTERM:
        case SIGHUP:
-               PARA_EMERG_LOG("terminating on signal %d\n", st->signum);
+               PARA_EMERG_LOG("terminating on signal %d\n", signum);
                clean_exit(EXIT_FAILURE, "caught deadly signal");
        }
 }
@@ -1023,9 +1024,7 @@ static void command_post_select(struct sched *s, struct task *t)
                last_status_dump = *now;
        }
 
-       if (!FD_ISSET(ct->fd, &s->rfds))
-               return;
-       ret = handle_connect(ct->fd);
+       ret = handle_connect(ct->fd, &s->rfds);
        if (ret < 0)
                PARA_ERROR_LOG("%s\n", para_strerror(-ret));
        audiod_status_dump();
@@ -1152,7 +1151,9 @@ static void status_pre_select(struct sched *s, struct task *t)
        ret = btr_node_status(st->btrn, 0, BTR_NT_LEAF);
        if (ret > 0)
                goto min_delay;
-       if (!st->ct)
+       if (st->ct && audiod_status == AUDIOD_OFF)
+               goto min_delay;
+       if (!st->ct && audiod_status != AUDIOD_OFF)
                sched_request_barrier_or_min_delay(&st->restart_barrier, s);
        if (cafn >= 0)
                sched_request_barrier(&afi[cafn].restart_barrier, s);