X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=audiod.c;h=5e0ff8d49f2dec598f1b87c64b1bf421dd9266a6;hp=9b79121b3aa16f51662b9e7e2649e097f81b5a26;hb=74d8b443aba528dc65af874a81c53be26aaace9e;hpb=7c11e1acf8efc93b36fcae77c3f0ce04ae491c23 diff --git a/audiod.c b/audiod.c index 9b79121b..5e0ff8d4 100644 --- a/audiod.c +++ b/audiod.c @@ -7,7 +7,7 @@ /** \file audiod.c the paraslash's audio daemon */ #include "para.h" - +#include "error.h" #include "audiod.cmdline.h" #include "list.h" #include "sched.h" @@ -24,7 +24,6 @@ #include "fd.h" #include "write.h" #include "write_common.h" -#include "error.h" #include "signal.h" /** define the array of error lists needed by para_audiod */ @@ -104,18 +103,6 @@ struct command_task { struct task task; }; -/** - * task for signal handling - */ -struct signal_task { - /** the signal pipe */ - int fd; - /** the number of the most recent signal */ - int signum; - /** the associated task structure */ - struct task task; -}; - /** iterate over all supported audio formats */ #define FOR_EACH_AUDIO_FORMAT(af) for (af = 0; af < NUM_AUDIO_FORMATS; af++) @@ -497,7 +484,7 @@ out: return count; } -static void check_stat_line(char *line) +static int check_stat_line(char *line, __a_unused void *data) { int itemnum; size_t ilen = 0; @@ -506,14 +493,14 @@ static void check_stat_line(char *line) // PARA_INFO_LOG("line: %s\n", line); if (!line) - return; + return 1; itemnum = stat_line_valid(line); if (itemnum < 0) { PARA_WARNING_LOG("invalid status line: %s\n", line); - return; + return 1; } if (stat_task->clock_diff_count && itemnum != SI_CURRENT_TIME) - return; + return 1; tmp = make_message("%s\n", line); stat_client_write(tmp, itemnum); free(tmp); @@ -557,6 +544,7 @@ static void check_stat_line(char *line) stat_task->clock_diff_count--; break; } + return 1; } static void try_to_close_slot(int slot_num) @@ -1068,7 +1056,7 @@ static void status_post_select(__a_unused struct sched *s, struct task *t) return; } bytes_left = for_each_line(st->pcd->buf, st->pcd->loaded, - &check_stat_line); + &check_stat_line, NULL); if (st->pcd->loaded != bytes_left) { st->last_status_read = *now; st->pcd->loaded = bytes_left;