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.54 by schorsch, Sun Jul 27 22:12:03 2003 UTC vs.
Revision 2.55 by greg, Mon Oct 20 16:01:55 2003 UTC

# Line 158 | Line 158 | setambient()                           /* initialize calculation */
158                  }
159                                                  /* align file pointer */
160                  pos += (long)nambvals*AMBVALSIZ;
161 <                flen = lseek(fileno(ambfp), (off_t)0L, 2);
161 >                flen = lseek(fileno(ambfp), (off_t)0, SEEK_END);
162                  if (flen != pos) {
163                          sprintf(errmsg,
164                          "ignoring last %ld values in ambient file (corrupted)",
# Line 829 | Line 829 | ambsync()                      /* synchronize ambient file */
829                                  /* gain exclusive access */
830          aflock(F_WRLCK);
831                                  /* see if file has grown */
832 <        if ((flen = lseek(fileno(ambfp), (off_t)0L, 2)) < 0)
832 >        if ((flen = lseek(fileno(ambfp), (off_t)0, SEEK_END)) < 0)
833                  goto seekerr;
834          if ( (n = flen - lastpos) ) {           /* file has grown */
835                  if (ambinp == NULL) {           /* use duplicate filedes */
# Line 852 | Line 852 | ambsync()                      /* synchronize ambient file */
852                  }
853                  /*** seek always as safety measure
854                  if (n) ***/                     /* alignment */
855 <                        if (lseek(fileno(ambfp), (off_t)(flen-n), 0) < 0)
855 >                        if (lseek(fileno(ambfp), (off_t)(flen-n), SEEK_SET) < 0)
856                                  goto seekerr;
857          }
858   #ifdef  DEBUG
# Line 865 | Line 865 | ambsync()                      /* synchronize ambient file */
865   #endif
866   syncend:
867          n = fflush(ambfp);                      /* calls write() at last */
868 <        if ((lastpos = lseek(fileno(ambfp), (off_t)0L, 1)) < 0)
868 >        if ((lastpos = lseek(fileno(ambfp), (off_t)0, SEEK_CUR)) < 0)
869                  goto seekerr;
870          aflock(F_UNLCK);                        /* release file */
871          nunflshed = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines