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

Comparing ray/src/gen/mkillum.c (file contents):
Revision 2.23 by greg, Thu Oct 28 00:50:47 2004 UTC vs.
Revision 2.26 by schorsch, Mon Sep 19 11:30:10 2005 UTC

# Line 9 | Line 9 | static const char RCSid[] = "$Id$";
9   #include  <ctype.h>
10  
11   #include  "platform.h"
12 #include  "rtprocess.h"
12   #include  "mkillum.h"
13   #include  "random.h"
14  
# Line 158 | Line 157 | main(          /* compute illum distributions using rtrace */
157          quit(0);
158   }
159  
160 +
161 + #ifndef SIGALRM
162 + #define SIGALRM SIGTERM
163 + #endif
164   static void
165   killpersist(void)                       /* kill persistent rtrace process */
166   {
# Line 171 | Line 174 | killpersist(void)                      /* kill persistent rtrace process
174          fclose(fp);
175   }
176  
177 +
178   int
179   done_rprocs(struct rtproc *rtp)
180   {
# Line 214 | Line 218 | init(int np)                           /* start rtrace and set up buffers */
218          ofun[OBJ_SPHERE].funp = o_sphere;
219          ofun[OBJ_RING].funp = o_ring;
220                                          /* set up signal handling */
221 < #ifdef SIGPIPE /* not present on Windows */
221 >        signal(SIGINT, quit);
222 > #ifdef SIGHUP
223 >        signal(SIGHUP, quit);
224 > #endif
225 > #ifdef SIGTERM
226 >        signal(SIGTERM, quit);
227 > #endif
228 > #ifdef SIGPIPE
229          signal(SIGPIPE, quit);
230   #endif
231          rtp = &rt0;                     /* start rtrace process(es) */
# Line 228 | Line 239 | init(int np)                           /* start rtrace and set up buffers */
239                  }
240                  if (maxbytes < 0)
241                          error(SYSTEM, "cannot start rtrace process");
231                if (!i && np > 1)
232                        sleep(2);       /* wait for persist file */
242                  rtp->bsiz = maxbytes/(6*sizeof(float));
243                  rtp->buf = (float *)malloc(6*sizeof(float)*rtp->bsiz--);
244                  rtp->dest = (float **)calloc(rtp->bsiz, sizeof(float *));
# Line 238 | Line 247 | init(int np)                           /* start rtrace and set up buffers */
247                  rtp->nrays = 0;
248                  if (i == np)            /* last process? */
249                          break;
250 +                if (np > 1)
251 +                        sleep(2);       /* wait for persist file */
252                  rtp->next = (struct rtproc *)malloc(sizeof(struct rtproc));
253                  if (rtp->next == NULL)
254                          error(SYSTEM, "out of memory in init");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines