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

Comparing ray/src/util/rpiece.c (file contents):
Revision 2.6 by greg, Fri Aug 7 11:34:27 1992 UTC vs.
Revision 2.7 by greg, Sat Aug 8 18:47:39 1992 UTC

# Line 172 | Line 172 | char  **av;
172          scanorig = ftell(fp);           /* record position of first scanline */
173          if (fclose(fp) == -1)           /* done with stream i/o */
174                  goto filerr;
175        sync();                         /* avoid NFS buffering */
175                                          /* start rpict process */
176          if (open_process(rpd, rpargv) <= 0) {
177                  fprintf(stderr, "%s: cannot start %s\n", progname, rpargv[0]);
# Line 304 | Line 303 | rpiece()                       /* render picture piece by piece */
303   putpiece(xpos, ypos)            /* get next piece from rpict */
304   int  xpos, ypos;
305   {
306 +        struct flock  fls;
307          int  hr, vr;
308          int  y;
309  
# Line 319 | Line 319 | int  xpos, ypos;
319                                  progname, rpargv[0]);
320                  exit(1);
321          }
322 +        fls.l_whence = 1;
323 +        fls.l_start = 0L;
324 +        fls.l_len = hr*sizeof(COLR);
325          for (y = 0; y < vr; y++) {      /* transfer scanlines */
326                  if (freadcolrs(scanline, hr, fromrp) < 0) {
327                          fprintf(stderr, "%s: read error from %s\n",
# Line 331 | Line 334 | scanorig+((long)((vmult-1-ypos)*vres+y)*hmult*hres+xpo
334                          fprintf(stderr, "%s: seek error\n", outfile);
335                          exit(1);
336                  }
337 +                fls.l_type = F_WRLCK;
338 +                fcntl(outfd, F_SETLKW, &fls);
339                  if (writebuf(outfd, (char *)scanline, hr*sizeof(COLR)) !=
340                                  hr*sizeof(COLR)) {
341                          fprintf(stderr, "%s: write error\n", outfile);
342                          exit(1);
343                  }
344 +                fls.l_type = F_UNLCK;
345 +                fcntl(outfd, F_SETLKW, &fls);
346          }
347   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines