pike.git / src / modules / _Stdio / sendfile.c

version» Context lines:

pike.git/src/modules/_Stdio/sendfile.c:665: Inside #if 0 /* mmap is slower than read/write on most if not all systems */ and #if defined(HAVE_MMAP) && defined(HAVE_MUNMAP)
   /* Shouldn't there be a goto here ? /Hubbe */    /* True. Fixed. /grubba */    goto send_trailers;    }    }    use_read_write:   #endif /* HAVE_MMAP && HAVE_MUNMAP */   #endif    SF_DFPRINTF((stderr, "sendfile: Using read() and write().\n"));    -  fd_lseek(this->from_fd, this->offset, SEEK_SET); +  while ((fd_lseek(this->from_fd, this->offset, SEEK_SET) < 0) && +  (errno == EINTR)) +  ; +     {    ptrdiff_t buflen;    ptrdiff_t len;    if ((this->len > this->buf_size) || (this->len < 0)) {    len = this->buf_size;    }    else    len = DO_NOT_WARN ((ptrdiff_t) this->len);    while ((buflen = fd_read(this->from_fd, this->buffer, len)) > 0) {    char *buf = this->buffer;