X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=recv.c;h=f9e5b9337f2e6775f0605d19e579438439e762d0;hp=0fe46411df8348cb92b65d2f22902f36f03d133f;hb=335730538150250f32c0df0b184fb494e2bb0df3;hpb=5c556c52f1196cea4536d36b683372de532943a9;ds=sidebyside diff --git a/recv.c b/recv.c index 0fe46411..f9e5b933 100644 --- a/recv.c +++ b/recv.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2007 Andre Noll + * Copyright (C) 2005-2008 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -45,14 +45,6 @@ static void *parse_config(int argc, char *argv[], int *receiver_num) return check_receiver_arg(conf.receiver_arg, receiver_num); } -static void rn_event_handler(struct task *t) -{ - struct receiver_node *rn = t->private_data; - PARA_NOTICE_LOG("%s\n", PARA_STRERROR(-t->ret)); - rn->eof = 1; - unregister_task(t); -} - /** * the main function of para_recv * @@ -81,7 +73,7 @@ int main(int argc, char *argv[]) ret = -E_RECV_SYNTAX; rn.conf = parse_config(argc, argv, &receiver_num); if (!rn.conf) { - PARA_EMERG_LOG("%s", "parse failed\n"); + PARA_EMERG_LOG("parse failed\n"); goto out; } r = &receivers[receiver_num]; @@ -94,13 +86,11 @@ int main(int argc, char *argv[]) stdout_set_defaults(&sot); sot.buf = rn.buf; sot.loaded = &rn.loaded; - sot.input_eof = &rn.eof; + sot.input_error = &rn.task.error; register_task(&sot.task); - rn.task.private_data = &rn; rn.task.pre_select = r->pre_select; rn.task.post_select = r->post_select; - rn.task.event_handler = rn_event_handler; sprintf(rn.task.status, "receiver node"); register_task(&rn.task); @@ -111,6 +101,6 @@ out: if (r) r->shutdown(); if (ret < 0) - PARA_ERROR_LOG("%s\n", PARA_STRERROR(-ret)); + PARA_ERROR_LOG("%s\n", para_strerror(-ret)); return ret < 0? EXIT_FAILURE : EXIT_SUCCESS; }