X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=recv.c;h=f872fec8b2f5c3ffdb250ad0b06ace34a2a5a904;hb=40cbbb95e256e63e1e6958e9034311d4904604af;hp=4b84e8b600cfeeb7d3907c8b292f97c2338730f2;hpb=39ef1da5509461b18beb5b8f16ff6118c20c0ac6;p=paraslash.git diff --git a/recv.c b/recv.c index 4b84e8b6..f872fec8 100644 --- a/recv.c +++ b/recv.c @@ -133,22 +133,14 @@ out: void rn_event_handler(struct task *t) { - PARA_ERROR_LOG("%s\n", PARA_STRERROR(-t->ret)); - unregister_task(t); -} - -void stdout_event_handler(struct task *t) -{ - PARA_ERROR_LOG("%s\n", PARA_STRERROR(-t->ret)); + PARA_NOTICE_LOG("%s\n", PARA_STRERROR(-t->ret)); unregister_task(t); } int main(int argc, char *argv[]) { - int ret, eof = 0, max, r_opened = 0, receiver_num; - struct timeval timeout; + int ret, r_opened = 0, receiver_num; struct receiver *r = NULL; - fd_set rfds, wfds; struct receiver_node rn; struct stdout_task sot; struct sched s; @@ -173,12 +165,7 @@ int main(int argc, char *argv[]) goto out; r_opened = 1; - sot.task.private_data = &sot; - sot.task.pre_select = stdout_pre_select; - sot.task.post_select = stdout_post_select; - sot.task.event_handler = stdout_event_handler; - sot.task.flags = 0; - sprintf(sot.task.status, "stdout writer"); + stdout_set_defaults(&sot); sot.buf = rn.buf; sot.loaded = &rn.loaded; sot.eof = &rn.eof;