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

Comparing ray/src/rt/rpict.c (file contents):
Revision 2.92 by greg, Thu Mar 21 16:52:40 2019 UTC vs.
Revision 2.96 by greg, Fri Dec 3 16:50:05 2021 UTC

# Line 135 | Line 135 | static int pixnumber(int  x, int  y, int  xres, int  y
135  
136  
137   void
138 < quit(code)                      /* quit program */
139 < int  code;
138 > quit(int code)                  /* quit program */
139   {
140          if (code)                       /* report status */
141                  report(0);
# Line 288 | Line 287 | rpict(                 /* generate image(s) */
287                          break;
288                  pctdone = 0.0;
289                  if (pout != NULL) {
290 +                        int     myfd;
291                          close(1);                       /* reassign stdout */
292                          sprintf(fbuf, pout, seq);
293 +                tryagain:
294                          errno = 0;                      /* exclusive open */
295 <                        if (open(fbuf, O_WRONLY|O_CREAT|O_EXCL, 0666) != 1) {
295 >                        if ((myfd = open(fbuf, O_WRONLY|O_CREAT|O_EXCL, 0666)) < 0) {
296                                  if ((errno != EEXIST) | (prvr != NULL) ||
297                                                  !strcmp(fbuf, pout)) {
298                                          sprintf(errmsg,
# Line 302 | Line 303 | rpict(                 /* generate image(s) */
303                                  setview(&ourview);
304                                  continue;               /* don't clobber */
305                          }
306 +                        if (myfd != 1) {
307 +                                unlink(fbuf);
308 +                                goto tryagain;          /* leave it open */
309 +                        }
310                          SET_FD_BINARY(1);
311                          dupheader();
312                  }
# Line 335 | Line 340 | rpict(                 /* generate image(s) */
340                  if ((pa < .99) | (pa > 1.01))
341                          fputaspect(pa, stdout);
342                  fputnow(stdout);
343 +                fputprims(stdprims, stdout);
344                  fputformat(COLRFMT, stdout);
345                  putchar('\n');
346                  if (zout != NULL)
# Line 654 | Line 660 | pixvalue(              /* compute pixel value */
660          int  y
661   )
662   {
657        extern void  SDsquare2disk(double ds[2], double seedx, double seedy);
663          RAY  thisray;
664          FVECT   lorg, ldir;
665          double  hpos, vpos, vdist, lmax;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines