--- ray/src/rt/rtmain.c 2003/05/13 17:58:33 2.3 +++ ray/src/rt/rtmain.c 2003/06/26 00:58:10 2.5 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rtmain.c,v 2.3 2003/05/13 17:58:33 greg Exp $"; +static const char RCSid[] = "$Id: rtmain.c,v 2.5 2003/06/26 00:58:10 schorsch Exp $"; #endif /* * rtmain.c - main for rtrace per-ray calculation program @@ -7,19 +7,16 @@ static const char RCSid[] = "$Id: rtmain.c,v 2.3 2003/ #include "copyright.h" -#include "ray.h" +#include +#include +#include "platform.h" +#include "ray.h" #include "source.h" - #include "ambient.h" - #include "random.h" - #include "paths.h" -#include - -#include /* persistent processes define */ #ifdef F_SETLKW #define PERSIST 1 /* normal persist */ @@ -237,10 +234,16 @@ char *argv[]; initurand(2048); /* set up signal handling */ sigdie(SIGINT, "Interrupt"); +#ifdef SIGHUP sigdie(SIGHUP, "Hangup"); +#endif sigdie(SIGTERM, "Terminate"); +#ifdef SIGPIPE sigdie(SIGPIPE, "Broken pipe"); +#endif +#ifdef SIGALRM sigdie(SIGALRM, "Alarm clock"); +#endif #ifdef SIGXCPU sigdie(SIGXCPU, "CPU limit exceeded"); sigdie(SIGXFSZ, "File size exceeded"); @@ -274,11 +277,11 @@ char *argv[]; openheader(); } #endif -#ifdef MSDOS +#ifdef _WIN32 if (outform != 'a') - setmode(fileno(stdout), O_BINARY); + SET_FILE_BINARY(stdout); if (octname == NULL) - setmode(fileno(stdin), O_BINARY); + SET_FILE_BINARY(stdin); #endif readoct(octname, loadflags, &thescene, NULL); nsceneobjs = nobjects; @@ -390,8 +393,10 @@ int signo; if (gotsig++) /* two signals and we're gone! */ _exit(signo); +#ifdef SIGALRM alarm(15); /* allow 15 seconds to clean up */ signal(SIGALRM, SIG_DFL); /* make certain we do die */ +#endif eputs("signal - "); eputs(sigerr[signo]); eputs("\n");