Simplify the scheduling code.
[paraslash.git] / recv.c
diff --git a/recv.c b/recv.c
index 55e97f1..f9e5b93 100644 (file)
--- a/recv.c
+++ b/recv.c
@@ -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->error = t->ret;
-       unregister_task(t);
-}
-
 /**
  * the main function of para_recv
  *
@@ -94,13 +86,11 @@ int main(int argc, char *argv[])
        stdout_set_defaults(&sot);
        sot.buf = rn.buf;
        sot.loaded = &rn.loaded;
-       sot.input_error = &rn.error;
+       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);