convert para_filter to the new scheduler
[paraslash.git] / write.c
diff --git a/write.c b/write.c
index 5bcd1f60aa4c430ef1ae35561ffcb40df25cce26..13b15a1d94034f95ae73fed94b3faba59fbf24eb 100644 (file)
--- a/write.c
+++ b/write.c
@@ -193,15 +193,6 @@ static void cwt_event_handler(struct task *t)
        register_task(&idt.task);
 }
 
-static void stdin_event_handler(struct task *t)
-{
-       unregister_task(t);
-       if (t->ret != -E_STDIN_EOF)
-               PARA_ERROR_LOG("%s\n", PARA_STRERROR(-t->ret));
-       else
-               PARA_INFO_LOG("%s\n", PARA_STRERROR(-t->ret));
-}
-
 int main(int argc, char *argv[])
 {
        int ret = -E_WRITE_SYNTAX;
@@ -214,14 +205,8 @@ int main(int argc, char *argv[])
        init_supported_writers();
        init_sched();
 
-       sit.bufsize = 16 * 1024,
-       sit.buf = para_malloc(16 * 1024),
-       sit.loaded = 0,
-       sit.task.pre_select = stdin_pre_select;
-       sit.task.post_select = stdin_post_select;
-       sit.task.event_handler = stdin_event_handler;
-       sit.task.private_data = &sit;
-       sprintf(sit.task.status, "stdin reader");
+       stdin_set_defaults(&sit);
+       sit.buf = para_malloc(sit.bufsize),
        register_task(&sit.task);
 
        cwt.task.pre_select = check_wav_pre_select;