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

Comparing ray/src/rt/ambient.c (file contents):
Revision 2.126 by greg, Mon Dec 9 00:44:29 2024 UTC vs.
Revision 2.127 by greg, Thu Dec 19 17:43:47 2024 UTC

# Line 665 | Line 665 | retry:
665                  fputc('\n', ambfp);
666                  putambmagic(ambfp);
667          } else if (getheader(ambfp, amb_headline, NULL) < 0 || !hasambmagic(ambfp)) {
668 < #ifndef  F_SETLKW
669 <                static int      ntries = 3;
670 <                if (--ntries > 0 && ftell(ambfp) == 0) {
668 >                int     ntries = 2;
669 >                if (ntries-- > 0 && ftell(ambfp) == 0) {
670 > #ifdef  F_SETLKW
671 >                        aflock(F_UNLCK);
672                          clearerr(ambfp);
673                          sleep(2);
674 +                        aflock(F_RDLCK);
675 + #else
676 +                        clearerr(ambfp);
677 +                        sleep(2);
678 + #endif
679                          goto retry;
680                  }
675 #endif
681                  error(USER, "bad/incompatible ambient file");
682          }
683          if ((AMB_CNDX != CNDX) | (AMB_WLPART != WLPART)) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines