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.64 by greg, Fri Sep 14 00:50:31 2007 UTC vs.
Revision 2.65 by greg, Sat Sep 15 02:47:30 2007 UTC

# Line 876 | Line 876 | ambsync(void)                  /* synchronize ambient file */
876          AMBVAL  avs;
877          register int  n;
878  
879 +        if (ambfp == NULL)      /* no ambient file? */
880 +                return(0);
881          if (lastpos < 0)        /* initializing (locked in initambfile) */
882                  goto syncend;
883                                  /* gain appropriate access */
# Line 918 | Line 920 | ambsync(void)                  /* synchronize ambient file */
920   #endif
921   syncend:
922          n = fflush(ambfp);                      /* calls write() at last */
923 <        if (n == EOF) {
923 >        if ((n == EOF) | (lastpos < 0)) {
924                  if ((lastpos = lseek(fileno(ambfp), (off_t)0, SEEK_CUR)) < 0)
925                          goto seekerr;
926          } else
# Line 936 | Line 938 | seekerr:
938   extern int
939   ambsync(void)                   /* flush ambient file */
940   {
941 +        if (ambfp == NULL)
942 +                return(0);
943          nunflshed = 0;
944          return(fflush(ambfp));
945   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines