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

Comparing ray/src/rt/rpmain.c (file contents):
Revision 2.2 by greg, Tue Feb 25 02:47:23 2003 UTC vs.
Revision 2.5 by greg, Thu Jul 3 18:03:58 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"
19
20 #include  <sys/types.h>
21
22 #include  <signal.h>
23
22   #include  "view.h"
23  
26 #include  "paths.h"
24                                          /* persistent processes define */
25   #ifdef  F_SETLKW
26   #define  PERSIST        1               /* normal persist */
# Line 234 | Line 231 | char  *argv[];
231          initurand(2048);
232                                          /* set up signal handling */
233          sigdie(SIGINT, "Interrupt");
234 + #ifdef SIGHUP
235          sigdie(SIGHUP, "Hangup");
236 + #endif
237          sigdie(SIGTERM, "Terminate");
238 + #ifdef SIGPIPE
239          sigdie(SIGPIPE, "Broken pipe");
240 + #endif
241 + #ifdef SIGALRM
242          sigdie(SIGALRM, "Alarm clock");
243 + #endif
244   #ifdef  SIGXCPU
245          sigdie(SIGXCPU, "CPU limit exceeded");
246          sigdie(SIGXFSZ, "File size exceeded");
# Line 278 | Line 281 | char  *argv[];
281   #endif
282          if (outfile != NULL)
283                  openheader();
284 < #ifdef  MSDOS
285 <        setmode(fileno(stdout), O_BINARY);
284 > #ifdef  _WIN32
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 289 | Line 292 | char  *argv[];
292          if (loadflags & IO_INFO) {      /* print header */
293                  printargs(i, argv, stdout);
294                  printf("SOFTWARE= %s\n", VersionID);
292                fputnow(stdout);
295          }
296  
297          marksources();                  /* find and mark sources */
# Line 398 | Line 400 | int  signo;
400          if (gotsig++)                   /* two signals and we're gone! */
401                  _exit(signo);
402  
403 + #ifdef SIGALRM /* XXX how critical is this? */
404          alarm(15);                      /* allow 15 seconds to clean up */
405          signal(SIGALRM, SIG_DFL);       /* make certain we do die */
406 + #endif
407          eputs("signal - ");
408          eputs(sigerr[signo]);
409          eputs("\n");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines