filter_chain.c: Cosmetics.
[paraslash.git] / client.c
index f47a0bec46a8c0d57f4ed2c22490a359ebbe8aed..cf115e03c7ef639ace1f1de12c5387e1968d4058 100644 (file)
--- a/client.c
+++ b/client.c
@@ -22,7 +22,7 @@ static struct client_task *ct;
 static struct stdin_task sit;
 static struct stdout_task sot;
 
-static void supervisor_pre_select(struct sched *s, struct task *t)
+static void supervisor_post_select(__a_unused struct sched *s, struct task *t)
 {
        if (ct->task.error < 0) {
                t->error = ct->task.error;
@@ -35,8 +35,8 @@ static void supervisor_pre_select(struct sched *s, struct task *t)
                ct->inbuf = sit.buf;
                ct->in_loaded = &sit.loaded;
                ct->in_error = &sit.task.error;
-               t->error = -1;
-               goto min_delay;
+               t->error = -E_TASK_STARTED;
+               return;
        }
        if (ct->status == CL_RECEIVING) {
                stdout_set_defaults(&sot);
@@ -44,17 +44,14 @@ static void supervisor_pre_select(struct sched *s, struct task *t)
                sot.loaded = &ct->loaded;
                sot.input_error = &ct->task.error;
                register_task(&sot.task);
-               t->error = -1;
-               goto min_delay;
+               t->error = -E_TASK_STARTED;
+               return;
        }
-       return;
-min_delay:
-       s->timeout.tv_sec = 0;
-       s->timeout.tv_usec = 1;
 }
 
 static struct task svt = {
-       .pre_select = supervisor_pre_select
+       .post_select = supervisor_post_select,
+       .status = "supervisor task"
 };
 
 INIT_STDERR_LOGGING(ct->conf.loglevel_arg);
@@ -78,7 +75,7 @@ int main(int argc, char *argv[])
 {
 
        int ret;
-       struct sched s;
+       static struct sched s;
 
        s.default_timeout.tv_sec = 1;
        s.default_timeout.tv_usec = 0;