Skip to content
Snippets Groups Projects
Commit d2e5211c authored by Mark Grondona's avatar Mark Grondona
Browse files

o use -1 for len in cbuf_read_to_fd() instead of 1 (amazing this wasn't

   caught til now)
 o Determine maximum allowable read size from tasks before attempting
   to write to readers in order to avoid dropping output.
parent 19254953
No related branches found
No related tags found
No related merge requests found
...@@ -1236,7 +1236,7 @@ _write(io_obj_t *obj, List objs) ...@@ -1236,7 +1236,7 @@ _write(io_obj_t *obj, List objs)
return 0; return 0;
} }
while ((n = cbuf_read_to_fd(io->buf, obj->fd, 1)) < 0) { while ((n = cbuf_read_to_fd(io->buf, obj->fd, -1)) < 0) {
switch (errno) { switch (errno) {
case EAGAIN: case EAGAIN:
return 0; return 0;
...@@ -1384,6 +1384,8 @@ _task_read(io_obj_t *obj, List objs) ...@@ -1384,6 +1384,8 @@ _task_read(io_obj_t *obj, List objs)
xassert((t->type == TASK_STDOUT) || (t->type == TASK_STDERR)); xassert((t->type == TASK_STDOUT) || (t->type == TASK_STDERR));
xassert(_validate_io_list(objs)); xassert(_validate_io_list(objs));
len = _max_readable (t, len);
again: again:
if ((n = read(obj->fd, (void *) buf, len)) < 0) { if ((n = read(obj->fd, (void *) buf, len)) < 0) {
if (errno == EINTR) if (errno == EINTR)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment