]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
client exec: Switch to the alternative post select method.
authorAndre Noll <maan@systemlinux.org>
Sun, 31 Mar 2013 18:47:50 +0000 (18:47 +0000)
committerAndre Noll <maan@systemlinux.org>
Tue, 30 Apr 2013 12:12:46 +0000 (14:12 +0200)
client.c

index 715df9c6a3aa8b107ef4bcfdffaad9a0c1abea2f..7f0e3211241a77dad0d6dbe5774f6671e49823f8 100644 (file)
--- a/client.c
+++ b/client.c
@@ -54,7 +54,7 @@ static void exec_pre_select(struct sched *s, struct task *t)
                sched_min_delay(s);
 }
 
-static void exec_post_select(__a_unused struct sched *s, struct task *t)
+static int exec_post_select(__a_unused struct sched *s, struct task *t)
 {
        struct exec_task *et = container_of(t, struct exec_task, task);
        struct btr_node *btrn = et->btrn;
@@ -63,10 +63,8 @@ static void exec_post_select(__a_unused struct sched *s, struct task *t)
        int ret;
 
        ret = btr_node_status(btrn, 0, BTR_NT_LEAF);
-       if (ret <= 0) {
-               t->error = ret;
-               return;
-       }
+       if (ret <= 0)
+               return ret;
        sz = btr_next_buffer(btrn, &buf);
        if (sz <= 1)
                goto out;
@@ -76,6 +74,7 @@ static void exec_post_select(__a_unused struct sched *s, struct task *t)
        et->result_buf[et->result_size - 1] = '\0';
 out:
        btr_consume(btrn, sz);
+       return 0;
 }
 
 static int make_client_argv(const char *line)
@@ -96,7 +95,8 @@ static int execute_client_command(const char *cmd, char **result)
        struct exec_task exec_task = {
                .task = {
                        .pre_select = exec_pre_select,
-                       .post_select = exec_post_select,
+                       .new_post_select = exec_post_select,
+                       .post_select = NULL,
                        .status = "client exec task",
                },
                .result_buf = para_strdup(""),