| 10 |
|
|
| 11 |
|
#include "rholo.h" |
| 12 |
|
#include "random.h" |
| 13 |
+ |
#include "paths.h" |
| 14 |
+ |
#include "selcall.h" |
| 15 |
|
#include <signal.h> |
| 16 |
|
#include <sys/time.h> |
| 17 |
|
|
| 18 |
|
#ifndef MAXPROC |
| 19 |
< |
#define MAXPROC 16 |
| 19 |
> |
#define MAXPROC 64 |
| 20 |
|
#endif |
| 21 |
|
|
| 22 |
< |
static char PFILE[] = "/usr/tmp/RHpersist"; /* persist file name */ |
| 22 |
> |
int nprocs = 0; /* running process count */ |
| 23 |
|
|
| 24 |
+ |
static char pfile[] = TEMPLATE; /* persist file name */ |
| 25 |
+ |
|
| 26 |
|
static int rtpd[MAXPROC][3]; /* process descriptors */ |
| 27 |
|
static float *rtbuf = NULL; /* allocated i/o buffer */ |
| 28 |
|
static int maxqlen = 0; /* maximum packets per queue */ |
| 25 |
– |
static int nprocs = 0; /* number of processes */ |
| 29 |
|
|
| 30 |
|
static PACKET *pqueue[MAXPROC]; /* packet queues */ |
| 31 |
|
static int pqlen[MAXPROC]; /* packet queue lengths */ |
| 56 |
|
rtargv[rtargc++] = "-x"; rtargv[rtargc++] = buf1; |
| 57 |
|
rtargv[rtargc++] = "-y"; rtargv[rtargc++] = "0"; |
| 58 |
|
rtargv[rtargc++] = "-fff"; |
| 59 |
< |
rtargv[rtargc++] = "-ovl"; |
| 60 |
< |
rtargv[rtargc++] = nowarn ? "-w-" : "-w+"; |
| 59 |
> |
rtargv[rtargc++] = vbool(VDIST) ? "-ovl" : "-ovL"; |
| 60 |
> |
if (nowarn) |
| 61 |
> |
rtargv[rtargc++] = "-w-"; |
| 62 |
|
if (npt > 1) { |
| 63 |
< |
rtargv[rtargc++] = "-PP"; rtargv[rtargc++] = PFILE; |
| 63 |
> |
mktemp(pfile); |
| 64 |
> |
rtargv[rtargc++] = "-PP"; rtargv[rtargc++] = pfile; |
| 65 |
|
} |
| 66 |
|
rtargv[rtargc++] = vval(OCTREE); |
| 67 |
|
rtargv[rtargc] = NULL; |
| 223 |
|
} |
| 224 |
|
return(pldone); /* return finished packets */ |
| 225 |
|
eoferr: |
| 226 |
< |
error(USER, "unexpected EOF from rtrace process"); |
| 226 |
> |
error(USER, "rtrace process died"); |
| 227 |
|
} |
| 228 |
|
|
| 229 |
|
|
| 257 |
|
if (pqlen[i]) { |
| 258 |
|
if (rpdone == NULL) { /* tack on queue */ |
| 259 |
|
rpdone = rpl = pqueue[i]; |
| 260 |
< |
nr = rpl->nr; |
| 260 |
> |
if ((nr = rpl->nr) < RPACKSIZ) nr++; |
| 261 |
|
} else { |
| 262 |
|
rpl->next = pqueue[i]; |
| 263 |
|
nr = 0; |
| 295 |
|
FILE *fp; |
| 296 |
|
int pid; |
| 297 |
|
|
| 298 |
< |
if ((fp = fopen(PFILE, "r")) == NULL) |
| 298 |
> |
if ((fp = fopen(pfile, "r")) == NULL) |
| 299 |
|
return; |
| 300 |
|
if (fscanf(fp, "%*s %d", &pid) != 1 || kill(pid, SIGALRM) < 0) |
| 301 |
< |
unlink(PFILE); |
| 301 |
> |
unlink(pfile); |
| 302 |
|
fclose(fp); |
| 303 |
|
} |
| 304 |
|
|