Changeset 924f7cd


Ignore:
Timestamp:
Dec 20, 2008, 9:47:21 PM (12 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, debian, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
bd8b991
Parents:
df7f364
Message:
Pull data from stderr in larger chunks at a time.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • owl.c

    rcf0cc64 r924f7cd  
    750750{
    751751  int navail, bread;
    752   char *buf;
     752  char buf[4096];
    753753  int rfd = d->fd;
    754754  if (rfd<0) return;
     
    757757  }
    758758  /*owl_function_debugmsg("stderr_redirect: navail = %d\n", navail);*/
    759   if (navail<=0) return;
    760   if (navail>256) { navail = 256; }
    761   buf = owl_malloc(navail+1);
     759  if (navail <= 0) return;
     760  if (navail > sizeof(buf)-1) {
     761    navail = sizeof(buf)-1;
     762  }
    762763  bread = read(rfd, buf, navail);
    763764  if (buf[navail-1] != '\0') {
    764765    buf[navail] = '\0';
    765766  }
    766   owl_function_error("Err: %s", buf);
    767   owl_free(buf);
     767  owl_function_error("[stderr]\n%s", buf);
    768768}
    769769
Note: See TracChangeset for help on using the changeset viewer.