]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - stdout.c
string: Clean up for_each_line() and related functions.
[paraslash.git] / stdout.c
index 1caa0e77023ff97d728fbe1445da8e3eb4bd5fdb..9c7e64e7284a3a3d247e76a7f9724f880e397a31 100644 (file)
--- a/stdout.c
+++ b/stdout.c
@@ -1,14 +1,12 @@
 /*
- * Copyright (C) 2006-2009 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2006-2013 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
 
 /** \file stdout.c Functions that deal with writing to stdout. */
 
-#include <dirent.h> /* readdir() */
 #include <assert.h>
-#include <stdbool.h>
 
 #include "para.h"
 #include "list.h"
@@ -70,14 +68,14 @@ static void stdout_post_select(struct sched *s, struct task *t)
                sz = btr_next_buffer(btrn, &buf);
                if (sz == 0)
                        break;
-               ret = write_nonblock(STDOUT_FILENO, buf, sz, 0);
+               ret = xwrite(STDOUT_FILENO, buf, sz);
                if (ret <= 0)
                        break;
                btr_consume(btrn, ret);
        }
 out:
        if (ret < 0)
-               btr_remove_node(btrn);
+               btr_remove_node(&sot->btrn);
        t->error = ret;
 }
 /**