--- ray/src/hd/rholo.c 2003/07/27 22:12:02 3.60 +++ ray/src/hd/rholo.c 2003/10/21 19:19:28 3.62 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rholo.c,v 3.60 2003/07/27 22:12:02 schorsch Exp $"; +static const char RCSid[] = "$Id: rholo.c,v 3.62 2003/10/21 19:19:28 schorsch Exp $"; #endif /* * Radiance holodeck generation controller @@ -10,6 +10,7 @@ static const char RCSid[] = "$Id: rholo.c,v 3.60 2003/ #include #include "rholo.h" +#include "platform.h" #include "random.h" #ifndef FRAGWARN @@ -269,12 +270,20 @@ initrholo() /* get our holodeck running */ } /* set up signal handling */ sigdie(SIGINT, "Interrupt"); - sigdie(SIGHUP, "Hangup"); sigdie(SIGTERM, "Terminate"); +#ifdef SIGHUP + sigdie(SIGHUP, "Hangup"); +#endif +#ifdef SIGPIPE sigdie(SIGPIPE, "Broken pipe"); +#endif +#ifdef SIGALRM sigdie(SIGALRM, "Alarm clock"); +#endif #ifdef SIGXCPU sigdie(SIGXCPU, "CPU limit exceeded"); +#endif +#ifdef SIGXFSZ sigdie(SIGXFSZ, "File size exceeded"); #endif /* protect holodeck file */ @@ -433,7 +442,7 @@ HDGRID *gp; putw(HOLOMAGIC, fp); /* put magic number */ fd = dup(fileno(fp)); fclose(fp); /* flush and close stdio stream */ - lastloc = lseek(fd, (off_t)0, 2); + lastloc = lseek(fd, (off_t)0, SEEK_END); for (n = vdef(SECTION); n--; gp++) { /* initialize each section */ nextloc = 0L; write(fd, (char *)&nextloc, sizeof(nextloc)); @@ -441,11 +450,11 @@ HDGRID *gp; if (!n) break; nextloc = hdfilen(fd); /* write section pointer */ - if (lseek(fd, (off_t)lastloc, 0) < 0) + if (lseek(fd, (off_t)lastloc, SEEK_SET) < 0) error(SYSTEM, "cannot seek on holodeck file in creatholo"); write(fd, (char *)&nextloc, sizeof(nextloc)); - lseek(fd, (off_t)(lastloc=nextloc), 0); + lseek(fd, (off_t)(lastloc=nextloc), SEEK_SET); } } @@ -512,7 +521,7 @@ loadholo() /* start loading a holodeck from fname */ fd = dup(fileno(fp)); fclose(fp); /* done with stdio */ for (n = 0; nextloc > 0L; n++) { /* initialize each section */ - lseek(fd, (off_t)nextloc, 0); + lseek(fd, (off_t)nextloc, SEEK_SET); read(fd, (char *)&nextloc, sizeof(nextloc)); hdinit(fd, NULL); }