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

Comparing ray/src/hd/rholo.c (file contents):
Revision 3.60 by schorsch, Sun Jul 27 22:12:02 2003 UTC vs.
Revision 3.63 by greg, Wed Oct 22 02:06:34 2003 UTC

# Line 9 | Line 9 | static const char      RCSid[] = "$Id$";
9   #include <sys/stat.h>
10   #include <string.h>
11  
12 + #include "platform.h"
13   #include "rholo.h"
14   #include "random.h"
15  
# Line 269 | Line 270 | initrholo()                    /* get our holodeck running */
270          }
271                                          /* set up signal handling */
272          sigdie(SIGINT, "Interrupt");
272        sigdie(SIGHUP, "Hangup");
273          sigdie(SIGTERM, "Terminate");
274 + #ifdef SIGHUP
275 +        sigdie(SIGHUP, "Hangup");
276 + #endif
277 + #ifdef SIGPIPE
278          sigdie(SIGPIPE, "Broken pipe");
279 + #endif
280 + #ifdef SIGALRM
281          sigdie(SIGALRM, "Alarm clock");
282 + #endif
283   #ifdef  SIGXCPU
284          sigdie(SIGXCPU, "CPU limit exceeded");
285 + #endif
286 + #ifdef  SIGXFSZ
287          sigdie(SIGXFSZ, "File size exceeded");
288   #endif
289                                          /* protect holodeck file */
# Line 433 | Line 442 | HDGRID *gp;
442          putw(HOLOMAGIC, fp);            /* put magic number */
443          fd = dup(fileno(fp));
444          fclose(fp);                     /* flush and close stdio stream */
445 <        lastloc = lseek(fd, (off_t)0, 2);
445 >        lastloc = lseek(fd, (off_t)0, SEEK_END);
446          for (n = vdef(SECTION); n--; gp++) {    /* initialize each section */
447                  nextloc = 0L;
448                  write(fd, (char *)&nextloc, sizeof(nextloc));
# Line 441 | Line 450 | HDGRID *gp;
450                  if (!n)
451                          break;
452                  nextloc = hdfilen(fd);          /* write section pointer */
453 <                if (lseek(fd, (off_t)lastloc, 0) < 0)
453 >                if (lseek(fd, (off_t)lastloc, SEEK_SET) < 0)
454                          error(SYSTEM,
455                                  "cannot seek on holodeck file in creatholo");
456                  write(fd, (char *)&nextloc, sizeof(nextloc));
457 <                lseek(fd, (off_t)(lastloc=nextloc), 0);
457 >                lseek(fd, (off_t)(lastloc=nextloc), SEEK_SET);
458          }
459   }
460  
# Line 512 | Line 521 | loadholo()                     /* start loading a holodeck from fname */
521          fd = dup(fileno(fp));
522          fclose(fp);                             /* done with stdio */
523          for (n = 0; nextloc > 0L; n++) {        /* initialize each section */
524 <                lseek(fd, (off_t)nextloc, 0);
524 >                lseek(fd, (off_t)nextloc, SEEK_SET);
525                  read(fd, (char *)&nextloc, sizeof(nextloc));
526                  hdinit(fd, NULL);
527          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines