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

Comparing ray/src/hd/holofile.c (file contents):
Revision 3.8 by gregl, Tue Nov 11 11:31:54 1997 UTC vs.
Revision 3.9 by gregl, Thu Dec 11 09:35:58 1997 UTC

# Line 435 | Line 435 | register int   i;
435                          nchanged += hdfreebeam(hdlist[i], 0);
436                  return(nchanged);
437          }
438 +        if (hp->fd < 0)                 /* check for recursive error */
439 +                return(-1);
440          if (i == 0) {                   /* clear entire holodeck */
441                  nchanged = 0;
442                  for (i = 1; i <= nbeams(hp); i++)
# Line 453 | Line 455 | register int   i;
455                  if (lseek(hp->fd, hp->bi[i].fo, 0) < 0)
456                          error(SYSTEM, "cannot seek on holodeck file");
457                  n = hp->bl[i]->nrm * sizeof(RAYVAL);
458 <                if (write(hp->fd, (char *)hdbray(hp->bl[i]), n) != n)
458 >                if (write(hp->fd, (char *)hdbray(hp->bl[i]), n) != n) {
459 >                        hp->fd = -1;            /* avoid recursive error */
460                          error(SYSTEM, "write error in hdfreebeam");
461 +                }
462          }
463          blglob(hp)->nrm -= hp->bl[i]->nrm;
464          free((char *)hp->bl[i]);                /* free memory */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines