X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=recv_common.c;h=535d8c16075dc931d4ec935630e1de92362e3af5;hp=a5689390987ac9c9b063dad200653e990268824e;hb=11ef83c4abb2ccbdf3f99a8adf98749b2b0656c2;hpb=a37e903213215dd36b11bbde4ea98e1d4590a472 diff --git a/recv_common.c b/recv_common.c index a5689390..535d8c16 100644 --- a/recv_common.c +++ b/recv_common.c @@ -7,6 +7,7 @@ /** \file recv_common.c common functions of para_recv and para_audiod */ #include +#include #include "para.h" #include "list.h" @@ -14,6 +15,7 @@ #include "ggo.h" #include "recv.h" #include "string.h" +#include "buffer_tree.h" DEFINE_RECEIVER_ARRAY; @@ -121,3 +123,16 @@ void print_receiver_helps(int detailed) ggo_print_help(&r->help, detailed); } } + +int generic_recv_pre_select(struct sched *s, struct task *t) +{ + struct receiver_node *rn = container_of(t, struct receiver_node, task); + int ret = btr_node_status(rn->btrn, 0, BTR_NT_ROOT); + + t->error = 0; + if (ret < 0) { + s->timeout.tv_sec = 0; + s->timeout.tv_usec = 1; + } + return ret; +}