ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/rcrop.c
(Generate patch)

Comparing ray/src/util/rcrop.c (file contents):
Revision 1.16 by greg, Fri May 17 20:50:57 2024 UTC vs.
Revision 1.17 by greg, Wed Jun 5 17:30:56 2024 UTC

# Line 98 | Line 98 | binary_copyf(FILE *fp, int asize)
98                                          /* check if fseek() useful */
99          if (skip_len > skip_thresh &&
100                          fseek(fp, ((long)rmin*width + cmin)*elsiz, SEEK_CUR) == 0) {
101 +                int     fd;
102                  off_t   curpos;
103                  buf = (char *)malloc(ncols*elsiz);
104                  if (!buf)
# Line 115 | Line 116 | binary_copyf(FILE *fp, int asize)
116                          }
117                  }
118   #else
119 +                fd = fileno(fp);
120                  curpos = ftello(fp);
121                  for (y = nrows; y-- > 0; curpos += width*elsiz) {
122 <                        if (pread(fileno(fp), buf, ncols*elsiz,
122 >                        if (pread(fd, buf, ncols*elsiz,
123                                                  curpos) != ncols*elsiz)
124                                  goto readerr;
125                          if (putbinary(buf, elsiz, ncols, stdout) != ncols)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines