9 |
|
#include <ctype.h> |
10 |
|
|
11 |
|
#include "platform.h" |
12 |
– |
#include "rtprocess.h" |
12 |
|
#include "mkillum.h" |
13 |
|
#include "random.h" |
14 |
|
|
213 |
|
ofun[OBJ_SPHERE].funp = o_sphere; |
214 |
|
ofun[OBJ_RING].funp = o_ring; |
215 |
|
/* set up signal handling */ |
216 |
< |
#ifdef SIGPIPE /* not present on Windows */ |
216 |
> |
signal(SIGINT, quit); |
217 |
> |
#ifdef SIGHUP |
218 |
> |
signal(SIGHUP, quit); |
219 |
> |
#endif |
220 |
> |
#ifdef SIGTERM |
221 |
> |
signal(SIGTERM, quit); |
222 |
> |
#endif |
223 |
> |
#ifdef SIGPIPE |
224 |
|
signal(SIGPIPE, quit); |
225 |
|
#endif |
226 |
|
rtp = &rt0; /* start rtrace process(es) */ |
234 |
|
} |
235 |
|
if (maxbytes < 0) |
236 |
|
error(SYSTEM, "cannot start rtrace process"); |
231 |
– |
if (!i && np > 1) |
232 |
– |
sleep(2); /* wait for persist file */ |
237 |
|
rtp->bsiz = maxbytes/(6*sizeof(float)); |
238 |
|
rtp->buf = (float *)malloc(6*sizeof(float)*rtp->bsiz--); |
239 |
|
rtp->dest = (float **)calloc(rtp->bsiz, sizeof(float *)); |
242 |
|
rtp->nrays = 0; |
243 |
|
if (i == np) /* last process? */ |
244 |
|
break; |
245 |
+ |
if (np > 1) |
246 |
+ |
sleep(2); /* wait for persist file */ |
247 |
|
rtp->next = (struct rtproc *)malloc(sizeof(struct rtproc)); |
248 |
|
if (rtp->next == NULL) |
249 |
|
error(SYSTEM, "out of memory in init"); |