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

Comparing ray/src/rt/rtmain.c (file contents):
Revision 2.3 by greg, Tue May 13 17:58:33 2003 UTC vs.
Revision 2.6 by schorsch, Mon Jun 30 14:59:12 2003 UTC

# Line 7 | Line 7 | static const char      RCSid[] = "$Id$";
7  
8   #include "copyright.h"
9  
10 < #include  "ray.h"
10 > #include  <sys/types.h>
11 > #include  <signal.h>
12 > #ifdef _WIN32
13 > #include <process.h> /* getpid() */
14 > #endif
15  
16 + #include  "platform.h"
17 + #include  "ray.h"
18   #include  "source.h"
13
19   #include  "ambient.h"
15
20   #include  "random.h"
17
21   #include  "paths.h"
22  
20 #include  <sys/types.h>
21
22 #include  <signal.h>
23                                          /* persistent processes define */
24   #ifdef  F_SETLKW
25   #define  PERSIST        1               /* normal persist */
# Line 237 | Line 237 | char  *argv[];
237          initurand(2048);
238                                          /* set up signal handling */
239          sigdie(SIGINT, "Interrupt");
240 + #ifdef SIGHUP
241          sigdie(SIGHUP, "Hangup");
242 + #endif
243          sigdie(SIGTERM, "Terminate");
244 + #ifdef SIGPIPE
245          sigdie(SIGPIPE, "Broken pipe");
246 + #endif
247 + #ifdef SIGALRM
248          sigdie(SIGALRM, "Alarm clock");
249 + #endif
250   #ifdef  SIGXCPU
251          sigdie(SIGXCPU, "CPU limit exceeded");
252          sigdie(SIGXFSZ, "File size exceeded");
# Line 274 | Line 280 | char  *argv[];
280                  openheader();
281          }
282   #endif
283 < #ifdef  MSDOS
283 > #ifdef  _WIN32
284          if (outform != 'a')
285 <                setmode(fileno(stdout), O_BINARY);
285 >                SET_FILE_BINARY(stdout);
286          if (octname == NULL)
287 <                setmode(fileno(stdin), O_BINARY);
287 >                SET_FILE_BINARY(stdin);
288   #endif
289          readoct(octname, loadflags, &thescene, NULL);
290          nsceneobjs = nobjects;
# Line 390 | Line 396 | int  signo;
396          if (gotsig++)                   /* two signals and we're gone! */
397                  _exit(signo);
398  
399 + #ifdef SIGALRM
400          alarm(15);                      /* allow 15 seconds to clean up */
401          signal(SIGALRM, SIG_DFL);       /* make certain we do die */
402 + #endif
403          eputs("signal - ");
404          eputs(sigerr[signo]);
405          eputs("\n");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines