--- ray/src/rt/rpmain.c 2003/02/25 02:47:23 2.2 +++ ray/src/rt/rpmain.c 2003/06/26 00:58:10 2.4 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rpmain.c,v 2.2 2003/02/25 02:47:23 greg Exp $"; +static const char RCSid[] = "$Id: rpmain.c,v 2.4 2003/06/26 00:58:10 schorsch Exp $"; #endif /* * rpmain.c - main for rpict batch rendering program @@ -7,23 +7,20 @@ static const char RCSid[] = "$Id: rpmain.c,v 2.2 2003/ #include "copyright.h" -#include "ray.h" +#include +#include +#ifdef _WIN32 + #include /* getpid */ +#endif +#include "platform.h" +#include "ray.h" #include "source.h" - #include "ambient.h" - #include "random.h" - #include "paths.h" - -#include - -#include - #include "view.h" -#include "paths.h" /* persistent processes define */ #ifdef F_SETLKW #define PERSIST 1 /* normal persist */ @@ -234,10 +231,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"); @@ -278,10 +281,10 @@ char *argv[]; #endif if (outfile != NULL) openheader(); -#ifdef MSDOS - setmode(fileno(stdout), O_BINARY); +#ifdef _WIN32 + SET_FILE_BINARY(stdout); if (octname == NULL) - setmode(fileno(stdin), O_BINARY); + SET_FILE_BINARY(stdin); #endif readoct(octname, loadflags, &thescene, NULL); nsceneobjs = nobjects; @@ -398,8 +401,10 @@ int signo; if (gotsig++) /* two signals and we're gone! */ _exit(signo); +#ifdef SIGALRM /* XXX how critical is this? */ 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");