--- ray/src/hd/rholo.c 1997/12/16 15:45:55 3.29 +++ ray/src/hd/rholo.c 1997/12/22 11:06:53 3.32 @@ -88,6 +88,8 @@ char *argv[]; goto userr; } /* get root file name */ + if (i >= argc) + goto userr; rootname(froot, hdkfile=argv[i++]); /* load variables? */ if (i < argc) @@ -262,20 +264,21 @@ memerr: rholo() /* holodeck main loop */ { - static int idle = 1; + static int idle = 0; PACKET *pl = NULL, *plend; register PACKET *p; time_t t; long l; - - if (outdev != NULL) /* check display */ - if (!disp_check(idle)) - return(0); - /* display only? */ - if (nprocs <= 0) { + /* check display */ + if (nprocs <= 0) idle = 1; - return(outdev != NULL); - } + if (outdev != NULL) { + if (!disp_check(idle)) + return(0); /* quit request */ + if (nprocs <= 0) + return(1); + } else if (idle) + return(0); /* all done */ /* check file size */ if (maxdisk > 0 && hdfilen(hdlist[0]->fd) >= maxdisk) { error(WARNING, "file limit exceeded"); @@ -488,7 +491,7 @@ PACKET *pl; p->next = freepacks; freepacks = p; } - if (n2flush > 512*RPACKSIZ*nprocs) { + if (n2flush > 1024*RPACKSIZ*nprocs) { hdflush(NULL); /* flush holodeck buffers */ n2flush = 0; }