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.27 by schorsch, Wed Jun 7 17:52:04 2006 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 156 | Line 155 | main(          /* compute illum distributions using rtrace */
155          else
156                  filter(stdin, "standard input");
157          quit(0);
158 +        return 0; /* pro forma return */
159   }
160  
161 +
162 + #ifndef SIGALRM
163 + #define SIGALRM SIGTERM
164 + #endif
165   static void
166   killpersist(void)                       /* kill persistent rtrace process */
167   {
# Line 171 | Line 175 | killpersist(void)                      /* kill persistent rtrace process
175          fclose(fp);
176   }
177  
178 +
179   int
180   done_rprocs(struct rtproc *rtp)
181   {
# Line 214 | Line 219 | init(int np)                           /* start rtrace and set up buffers */
219          ofun[OBJ_SPHERE].funp = o_sphere;
220          ofun[OBJ_RING].funp = o_ring;
221                                          /* set up signal handling */
222 < #ifdef SIGPIPE /* not present on Windows */
222 >        signal(SIGINT, quit);
223 > #ifdef SIGHUP
224 >        signal(SIGHUP, quit);
225 > #endif
226 > #ifdef SIGTERM
227 >        signal(SIGTERM, quit);
228 > #endif
229 > #ifdef SIGPIPE
230          signal(SIGPIPE, quit);
231   #endif
232          rtp = &rt0;                     /* start rtrace process(es) */
# Line 228 | Line 240 | init(int np)                           /* start rtrace and set up buffers */
240                  }
241                  if (maxbytes < 0)
242                          error(SYSTEM, "cannot start rtrace process");
231                if (!i && np > 1)
232                        sleep(2);       /* wait for persist file */
243                  rtp->bsiz = maxbytes/(6*sizeof(float));
244                  rtp->buf = (float *)malloc(6*sizeof(float)*rtp->bsiz--);
245                  rtp->dest = (float **)calloc(rtp->bsiz, sizeof(float *));
# Line 238 | Line 248 | init(int np)                           /* start rtrace and set up buffers */
248                  rtp->nrays = 0;
249                  if (i == np)            /* last process? */
250                          break;
251 +                if (np > 1)
252 +                        sleep(2);       /* wait for persist file */
253                  rtp->next = (struct rtproc *)malloc(sizeof(struct rtproc));
254                  if (rtp->next == NULL)
255                          error(SYSTEM, "out of memory in init");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines