pike.git / src / modules / Pipe / pipe.c

version» Context lines:

pike.git/src/modules/Pipe/pipe.c:321:    struct buffer *b;       debug_malloc_touch(s);       if(THIS->fd!= -1)    {    ptrdiff_t len = s->len;    char *data = s->str;    ptrdiff_t bytes;    -  fd_lseek(THIS->fd, THIS->pos, SEEK_SET); +  while ((fd_lseek(THIS->fd, THIS->pos, SEEK_SET) < 0) && (errno == EINTR)) +  ;    while (len > 0) {    do {    bytes = fd_write(THIS->fd, data, len);    } while ((bytes < 0) && (errno == EINTR));    if (bytes < 0) break;    data += bytes;    len -= bytes;    }    THIS->pos+=s->len;    return 0;
pike.git/src/modules/Pipe/pipe.c:484:       /* We have a file cache, read from it */    if (this->fd!=-1)    {    char buffer[READ_BUFFER_SIZE];    ptrdiff_t sz = this->pos-pos;       if (sz <= 0) return NULL; /* no data */    if (sz > READ_BUFFER_SIZE) sz = READ_BUFFER_SIZE;    THREADS_ALLOW(); -  fd_lseek(this->fd, pos, SEEK_SET); +  while ((fd_lseek(this->fd, pos, SEEK_SET) < 0) && (errno == EINTR)) +  ;    THREADS_DISALLOW();    do {    THREADS_ALLOW();    len = fd_read(this->fd, buffer, sz);    THREADS_DISALLOW();    if (len < 0) {    if (errno != EINTR) {    return(NULL);    }    check_threads_etc();
pike.git/src/modules/Pipe/pipe.c:894:    THIS->pos=fd_lseek(fd, 0L, SEEK_CUR);       THIS->living_outputs++;       while (THIS->firstbuffer)    {    ptrdiff_t len;    char *data;    b=THIS->firstbuffer;    THIS->firstbuffer=b->next; -  fd_lseek(THIS->fd, THIS->pos, SEEK_SET); +  while ((fd_lseek(THIS->fd, THIS->pos, SEEK_SET) < 0) && +  (errno == EINTR)) +  ;       len = b->s->len;    data = b->s->str;    while (len > 0) {    ptrdiff_t bytes;    do {    bytes = fd_write(THIS->fd, data, len);    } while((bytes < 0) && (errno == EINTR));    if (bytes < 0) break;    len -= bytes;