/*
- * Copyright (C) 2006-2008 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2006-2009 Andre Noll <maan@systemlinux.org>
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
#include <dirent.h> /* readdir() */
#include <assert.h>
-
#include "para.h"
-#include "string.h"
#include "list.h"
#include "sched.h"
#include "fd.h"
static void stdin_pre_select(struct sched *s, struct task *t)
{
struct stdin_task *sit = container_of(t, struct stdin_task, task);
+
+ if (sit->output_error && *sit->output_error < 0) {
+ t->error = *sit->output_error;
+ return;
+ }
t->error = 0;
sit->check_fd = 0;
if (sit->loaded >= sit->bufsize)
struct stdin_task *sit = container_of(t, struct stdin_task, task);
ssize_t ret;
+ if (sit->output_error && *sit->output_error < 0) {
+ t->error = *sit->output_error;
+ return;
+ }
t->error = 0;
if (!sit->check_fd)
return;
{
int ret;
- sit->bufsize = 16 * 1024,
+ sit->bufsize = 32 * 1024,
sit->task.pre_select = stdin_pre_select;
sit->task.post_select = stdin_post_select;
sprintf(sit->task.status, "stdin reader");
ret = mark_fd_nonblocking(STDIN_FILENO);
if (ret >= 0)
return;
+ sit->output_error = NULL;
PARA_EMERG_LOG("%s\n", para_strerror(-ret));
exit(EXIT_FAILURE);
}