]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - stdout.c
aft: Make get_afsi_of_path() static.
[paraslash.git] / stdout.c
index 0cf4876db49125efe83e733e6c5f5c7ee921aa45..cf33bf6d0b67cf49625d27b4d602dec35922d32d 100644 (file)
--- a/stdout.c
+++ b/stdout.c
@@ -30,7 +30,6 @@ static void stdout_pre_select(struct sched *s, struct task *t)
        struct stdout_task *sot = container_of(t, struct stdout_task, task);
        int ret;
 
        struct stdout_task *sot = container_of(t, struct stdout_task, task);
        int ret;
 
-       t->error = 0;
        ret = btr_node_status(sot->btrn, 0, BTR_NT_LEAF);
        if (ret > 0)
                para_fd_set(STDOUT_FILENO, &s->wfds, &s->max_fileno);
        ret = btr_node_status(sot->btrn, 0, BTR_NT_LEAF);
        if (ret > 0)
                para_fd_set(STDOUT_FILENO, &s->wfds, &s->max_fileno);
@@ -47,7 +46,7 @@ static void stdout_pre_select(struct sched *s, struct task *t)
  * This function writes input data from the buffer tree to stdout if \p
  * STDOUT_FILENO is writable.
  */
  * This function writes input data from the buffer tree to stdout if \p
  * STDOUT_FILENO is writable.
  */
-static void stdout_post_select(struct sched *s, struct task *t)
+static int stdout_post_select(struct sched *s, struct task *t)
 {
        struct stdout_task *sot = container_of(t, struct stdout_task, task);
        struct btr_node *btrn = sot->btrn;
 {
        struct stdout_task *sot = container_of(t, struct stdout_task, task);
        struct btr_node *btrn = sot->btrn;
@@ -55,14 +54,13 @@ static void stdout_post_select(struct sched *s, struct task *t)
        char *buf;
        size_t sz;
 
        char *buf;
        size_t sz;
 
-       t->error = 0;
        ret = btr_node_status(btrn, 0, BTR_NT_LEAF);
        if (ret < 0)
                goto out;
        if (ret == 0)
        ret = btr_node_status(btrn, 0, BTR_NT_LEAF);
        if (ret < 0)
                goto out;
        if (ret == 0)
-               return;
+               return 0;
        if (!FD_ISSET(STDOUT_FILENO, &s->wfds))
        if (!FD_ISSET(STDOUT_FILENO, &s->wfds))
-               return;
+               return 0;
 
        if (sot->must_set_nonblock_flag) {
                ret = mark_fd_nonblocking(STDOUT_FILENO);
 
        if (sot->must_set_nonblock_flag) {
                ret = mark_fd_nonblocking(STDOUT_FILENO);
@@ -85,7 +83,7 @@ out:
                /* Revert to blocking mode if necessary. */
                fcntl(STDOUT_FILENO, F_SETFL, sot->fd_flags);
        }
                /* Revert to blocking mode if necessary. */
                fcntl(STDOUT_FILENO, F_SETFL, sot->fd_flags);
        }
-       t->error = ret;
+       return ret;
 }
 /**
  * Initialize a stdout task structure with default values.
 }
 /**
  * Initialize a stdout task structure with default values.