9 |
|
#include <ctype.h> |
10 |
|
|
11 |
|
#include "platform.h" |
12 |
– |
#include "rtprocess.h" |
12 |
|
#include "mkillum.h" |
13 |
|
#include "random.h" |
14 |
|
|
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 |
|
{ |
175 |
|
fclose(fp); |
176 |
|
} |
177 |
|
|
178 |
+ |
|
179 |
|
int |
180 |
|
done_rprocs(struct rtproc *rtp) |
181 |
|
{ |
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) */ |
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 *)); |
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"); |