X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=stdout.c;h=d64586bccd9cdd12ffe743247680d8686ee1c002;hp=b1e1bcb6f1edb0f986b4bf840cf8ef3ee57b3c55;hb=395aeb9da9c9cc2febe91b5a906c72e59e217594;hpb=5ab853b37a9fae7cf93ca809bf98d443440b6184 diff --git a/stdout.c b/stdout.c index b1e1bcb6..d64586bc 100644 --- a/stdout.c +++ b/stdout.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2008 Andre Noll + * Copyright (C) 2006-2009 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -10,7 +10,6 @@ #include #include "para.h" -#include "string.h" #include "list.h" #include "sched.h" #include "fd.h" @@ -62,20 +61,20 @@ static void stdout_post_select(struct sched *s, struct task *t) t->error = 0; if (!sot->check_fd) { - if (*sot->input_error < 0) + if (!*sot->loaded && *sot->input_error < 0) t->error = *sot->input_error; return; } if (!FD_ISSET(STDOUT_FILENO, &s->wfds)) return; - ret = write(STDOUT_FILENO, sot->buf, *sot->loaded); + ret = write(STDOUT_FILENO, *sot->bufp, *sot->loaded); if (ret < 0) { t->error = -ERRNO_TO_PARA_ERROR(errno); return; } *sot->loaded -= ret; if (*sot->loaded) - memmove(sot->buf, sot->buf + ret, *sot->loaded); + memmove(*sot->bufp, *sot->bufp + ret, *sot->loaded); } /**