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

version» Context lines:

pike.git/src/modules/Pipe/pipe.c:878:    && S_ISREG(s.st_mode)    && (THIS->fd=fd_dup(fd))!=-1 )    {    /* keep the file pointer of the duped fd */    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); -  fd_write(THIS->fd,b->s->str,b->s->len); +  +  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; +  data += bytes; +  } +     sbuffers-=b->s->len;    nbuffers--;    free_string(b->s);    free((char *)b);    }    THIS->lastbuffer=NULL;       /* keep the file pointer of the duped fd    THIS->pos=0; */    push_int(0);