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;
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;