| 23 |  |  | 
| 24 |  | static char     pfile[] = TEMPLATE;             /* persist file name */ | 
| 25 |  |  | 
| 26 | < | static SUBPROC  rtpd[MAXPROC];          /* process descriptors */ | 
| 26 | > | static SUBPROC  rtpd[MAXPROC];                  /* process descriptors */ | 
| 27 |  | static float    *rtbuf = NULL;                  /* allocated i/o buffer */ | 
| 28 | < | static int      maxqlen = 0;                    /* maximum packets per queue */ | 
| 28 | > | static int      maxqlen;                        /* maximum packets per queue */ | 
| 29 |  |  | 
| 30 |  | static PACKET   *pqueue[MAXPROC];               /* packet queues */ | 
| 31 |  | static int      pqlen[MAXPROC];                 /* packet queue lengths */ | 
| 59 |  | rtargv[rtargc++] = "-I-"; | 
| 60 |  | rtargv[rtargc++] = "-h-"; | 
| 61 |  | rtargv[rtargc++] = "-ld-"; | 
| 62 | + | rtargv[rtargc++] = "-pRGB"; | 
| 63 |  | sprintf(buf1, "%d", RPACKSIZ); | 
| 64 |  | rtargv[rtargc++] = "-x"; rtargv[rtargc++] = buf1; | 
| 65 |  | rtargv[rtargc++] = "-y"; rtargv[rtargc++] = "0"; | 
| 79 |  | psiz = open_process(&rtpd[nprocs], rtargv); | 
| 80 |  | if (psiz <= 0) | 
| 81 |  | error(SYSTEM, "cannot start rtrace process"); | 
| 82 | < | n = psiz/(RPACKSIZ*6*sizeof(float)); | 
| 83 | < | if (maxqlen == 0) { | 
| 84 | < | if (!(maxqlen = n)) | 
| 84 | < | error(INTERNAL, | 
| 85 | < | "bad pipe buffer size assumption"); | 
| 82 | > | n = psiz/(RPACKSIZ*6*sizeof(float)) + 1; | 
| 83 | > | if (!maxqlen) { | 
| 84 | > | maxqlen = n; | 
| 85 |  | sleep(2); | 
| 86 |  | } else if (n != maxqlen) | 
| 87 |  | error(INTERNAL, "varying pipe buffer size!"); | 
| 112 |  | if (pqlen[i] == pqlen[pn]) | 
| 113 |  | cnt++; | 
| 114 |  | /* break ties fairly */ | 
| 115 | < | if ((cnt = random() % cnt)) | 
| 115 | > | if ((cnt = irandom(cnt))) | 
| 116 |  | for (i = pn; i < nprocs; i++) | 
| 117 |  | if (pqlen[i] == pqlen[pn] && !cnt--) | 
| 118 |  | return(i); | 
| 145 |  | packrays(rtbuf, p); | 
| 146 |  | if ((n = p->nr) < RPACKSIZ)     /* add flush block? */ | 
| 147 |  | memset((char *)(rtbuf+6*n++), '\0', 6*sizeof(float)); | 
| 148 | < | if (writebuf(rtpd[pn].w, (char *)rtbuf, 6*sizeof(float)*n) < 0) | 
| 148 | > | if (writebuf(rtpd[pn].w, rtbuf, 6*sizeof(float)*n) < 0) | 
| 149 |  | error(SYSTEM, "write error in queue_packet"); | 
| 150 |  | p->next = NULL; | 
| 151 |  | if (!pqlen[pn]++)       /* add it to the end of the queue */ | 
| 280 |  | if (rpl->nr < RPACKSIZ) | 
| 281 |  | nr++;           /* add flush block */ | 
| 282 |  | } | 
| 283 | < | n = readbuf(rtpd[i].r, (char *)rtbuf, | 
| 285 | < | 4*sizeof(float)*nr); | 
| 283 | > | n = readbuf(rtpd[i].r, rtbuf, 4*sizeof(float)*nr); | 
| 284 |  | if (n < 0) | 
| 285 |  | error(SYSTEM, "read failure in flush_queue"); | 
| 286 |  | bp = rtbuf;                     /* process packets */ |