9 |
|
*/ |
10 |
|
|
11 |
|
#include "rholo.h" |
12 |
< |
#include "paths.h" |
12 |
> |
#include "random.h" |
13 |
|
#include <signal.h> |
14 |
|
#include <sys/types.h> |
15 |
|
#include <sys/stat.h> |
21 |
|
|
22 |
|
char *progname; /* our program name */ |
23 |
|
char *hdkfile; /* holodeck file name */ |
24 |
< |
char froot[MAXPATH]; /* root file name */ |
24 |
> |
char froot[256]; /* root file name */ |
25 |
|
|
26 |
|
int nowarn = 0; /* turn warnings off? */ |
27 |
|
|
28 |
– |
double expval = 1.; /* global exposure value */ |
29 |
– |
|
28 |
|
int ncprocs = 0; /* desired number of compute processes */ |
29 |
|
|
30 |
|
char *outdev = NULL; /* output device name */ |
31 |
|
|
32 |
+ |
int readinp = 0; /* read commands from stdin */ |
33 |
+ |
|
34 |
+ |
int force = 0; /* allow overwrite of holodeck */ |
35 |
+ |
|
36 |
|
time_t starttime; /* time we got started */ |
37 |
|
time_t endtime; /* time we should end by */ |
38 |
|
time_t reporttime; /* time for next report */ |
58 |
|
int argc; |
59 |
|
char *argv[]; |
60 |
|
{ |
59 |
– |
HDGRID hdg; |
61 |
|
int i; |
61 |
– |
int force = 0; |
62 |
|
/* mark start time */ |
63 |
|
starttime = time(NULL); |
64 |
+ |
initurand(16384); /* initialize urand */ |
65 |
|
progname = argv[0]; /* get arguments */ |
66 |
|
for (i = 1; i < argc && argv[i][0] == '-'; i++) |
67 |
|
switch (argv[i][1]) { |
71 |
|
case 'f': /* force overwrite */ |
72 |
|
force++; |
73 |
|
break; |
74 |
+ |
case 'i': /* read input from stdin */ |
75 |
+ |
readinp++; |
76 |
+ |
break; |
77 |
|
case 'n': /* compute processes */ |
78 |
|
if (i >= argc-2) |
79 |
|
goto userr; |
87 |
|
default: |
88 |
|
goto userr; |
89 |
|
} |
86 |
– |
/* do we have a job? */ |
87 |
– |
if (outdev == NULL && ncprocs <= 0) |
88 |
– |
goto userr; |
90 |
|
/* get root file name */ |
91 |
|
rootname(froot, hdkfile=argv[i++]); |
92 |
< |
/* load... */ |
93 |
< |
if (i < argc) { /* variables */ |
94 |
< |
loadvars(argv[i++]); |
95 |
< |
/* cmdline settings */ |
96 |
< |
for ( ; i < argc; i++) |
97 |
< |
if (setvariable(argv[i], matchvar) < 0) { |
98 |
< |
sprintf(errmsg, "unknown variable: %s", |
99 |
< |
argv[i]); |
100 |
< |
error(USER, errmsg); |
101 |
< |
} |
102 |
< |
/* check settings */ |
103 |
< |
checkvalues(); |
104 |
< |
/* load RIF if any */ |
105 |
< |
if (vdef(RIF)) |
106 |
< |
getradfile(vval(RIF)); |
92 |
> |
/* load variables? */ |
93 |
> |
if (i < argc) |
94 |
> |
if (argv[i][0] != '-' && argv[i][0] != '+') |
95 |
> |
loadvars(argv[i]); /* load variables from file */ |
96 |
> |
|
97 |
> |
if (i >= argc || argv[i][0] == '+') |
98 |
> |
loadholo(); /* load existing holodeck */ |
99 |
> |
|
100 |
> |
while (++i < argc) /* get command line settings */ |
101 |
> |
if (setvariable(argv[i], matchvar) < 0) { |
102 |
> |
sprintf(errmsg, "unknown variable: %s", argv[i]); |
103 |
> |
error(USER, errmsg); |
104 |
> |
} |
105 |
> |
/* check settings */ |
106 |
> |
checkvalues(); |
107 |
> |
/* load RIF if any */ |
108 |
> |
getradfile(); |
109 |
> |
|
110 |
> |
if (hdlist[0] == NULL) { /* create new holodeck */ |
111 |
> |
HDGRID hdg[HDMAX]; |
112 |
|
/* set defaults */ |
113 |
< |
setdefaults(&hdg); |
113 |
> |
setdefaults(hdg); |
114 |
|
/* holodeck exists? */ |
115 |
|
if (!force && access(hdkfile, R_OK|W_OK) == 0) |
116 |
|
error(USER, |
117 |
|
"holodeck file exists -- use -f to overwrite"); |
118 |
|
/* create holodeck */ |
119 |
< |
creatholo(&hdg); |
120 |
< |
} else { /* else load holodeck */ |
121 |
< |
loadholo(); |
116 |
< |
if (vdef(RIF)) /* load RIF if any */ |
117 |
< |
getradfile(vval(RIF)); |
118 |
< |
} |
119 |
> |
creatholo(hdg); |
120 |
> |
} else /* else just set defaults */ |
121 |
> |
setdefaults(NULL); |
122 |
|
/* initialize */ |
123 |
|
initrholo(); |
124 |
< |
/* run */ |
124 |
> |
/* main loop */ |
125 |
|
while (rholo()) |
126 |
|
; |
127 |
|
/* done */ |
128 |
|
quit(0); |
129 |
|
userr: |
130 |
|
fprintf(stderr, |
131 |
< |
"Usage: %s {-n nprocs|-o disp} [-w][-f] output.hdk [control.hif [VAR=val ..]]\n", |
131 |
> |
"Usage: %s [-n nprocs][-o disp][-w][-f] output.hdk [control.hif|+|- [VAR=val ..]]\n", |
132 |
|
progname); |
133 |
|
quit(1); |
134 |
|
} |
142 |
|
if (gotsig++) /* two signals and we're gone! */ |
143 |
|
_exit(signo); |
144 |
|
|
145 |
< |
alarm(30); /* allow 30 seconds to clean up */ |
145 |
> |
alarm(60); /* allow 60 seconds to clean up */ |
146 |
|
signal(SIGALRM, SIG_DFL); /* make certain we do die */ |
147 |
|
eputs("signal - "); |
148 |
|
eputs(sigerr[signo]); |
185 |
|
{ |
186 |
|
extern int global_packet(); |
187 |
|
register int i; |
188 |
+ |
/* close holodeck on exec() */ |
189 |
+ |
fcntl(hdlist[0]->fd, F_SETFD, FD_CLOEXEC); |
190 |
|
|
191 |
|
if (outdev != NULL) /* open output device */ |
192 |
|
disp_open(outdev); |
201 |
|
if (!vdef(TIME) || vflt(TIME) <= FTINY) |
202 |
|
endtime = 0; |
203 |
|
else |
204 |
< |
endtime = starttime + vflt(TIME)*3600.; |
204 |
> |
endtime = starttime + vflt(TIME)*3600. + .5; |
205 |
|
/* set up memory cache */ |
206 |
|
if (outdev == NULL) |
207 |
|
hdcachesize = 0; /* manual flushing */ |
217 |
|
if (ncprocs > 0) { |
218 |
|
i = start_rtrace(); |
219 |
|
if (i < 1) |
220 |
< |
error(USER, "cannot start rtrace process"); |
220 |
> |
error(USER, "cannot start rtrace process(es)"); |
221 |
|
if (vdef(REPORT)) { /* make first report */ |
222 |
|
printargs(rtargc, rtargv, stderr); |
223 |
|
report(0); |
228 |
|
goto memerr; |
229 |
|
freepacks[--i].nr = 0; |
230 |
|
freepacks[i].next = NULL; |
231 |
< |
if (!vbool(OBSTRUCTIONS)) { |
231 |
> |
if (!vdef(OBSTRUCTIONS) || !vbool(OBSTRUCTIONS)) { |
232 |
|
freepacks[i].offset = (float *)bmalloc( |
233 |
|
RPACKSIZ*sizeof(float)*(i+1) ); |
234 |
|
if (freepacks[i].offset == NULL) |
272 |
|
if (!disp_check(idle)) |
273 |
|
return(0); |
274 |
|
/* display only? */ |
275 |
< |
if (ncprocs <= 0) |
276 |
< |
return(1); |
275 |
> |
if (nprocs <= 0) { |
276 |
> |
idle = 1; |
277 |
> |
return(outdev != NULL); |
278 |
> |
} |
279 |
|
/* check file size */ |
280 |
|
if (maxdisk > 0 && hdfilen(hdlist[0]->fd) >= maxdisk) { |
281 |
|
error(WARNING, "file limit exceeded"); |
282 |
< |
return(0); |
282 |
> |
done_rtrace(); |
283 |
> |
return(1); /* comes back */ |
284 |
|
} |
285 |
|
/* check time */ |
286 |
|
if (endtime > 0 || reporttime > 0) |
287 |
|
t = time(NULL); |
288 |
|
if (endtime > 0 && t >= endtime) { |
289 |
|
error(WARNING, "time limit exceeded"); |
290 |
< |
return(0); |
290 |
> |
done_rtrace(); |
291 |
> |
return(1); /* comes back */ |
292 |
|
} |
293 |
|
if (reporttime > 0 && t >= reporttime) |
294 |
|
report(t); |
295 |
< |
/* get packets to process */ |
295 |
> |
idle = 0; /* get packets to process */ |
296 |
|
while (freepacks != NULL) { |
297 |
|
p = freepacks; freepacks = p->next; p->next = NULL; |
298 |
|
if (!next_packet(p)) { |
299 |
|
p->next = freepacks; freepacks = p; |
300 |
+ |
idle = 1; |
301 |
|
break; |
302 |
|
} |
303 |
|
if (pl == NULL) pl = p; |
304 |
|
else plend->next = p; |
305 |
|
plend = p; |
306 |
|
} |
307 |
< |
idle = pl == NULL && freepacks != NULL; |
298 |
< |
/* are we out of stuff to do? */ |
299 |
< |
if (idle && outdev == NULL) |
300 |
< |
return(0); |
301 |
< |
/* else process packets */ |
307 |
> |
/* process packets */ |
308 |
|
done_packets(do_packets(pl)); |
309 |
|
return(1); /* and continue */ |
310 |
|
} |
311 |
|
|
312 |
|
|
307 |
– |
report(t) /* report progress so far */ |
308 |
– |
time_t t; |
309 |
– |
{ |
310 |
– |
if (t == 0) |
311 |
– |
t = time(NULL); |
312 |
– |
fprintf(stderr, "%s: %ld packets (%ld rays) done after %.2f hours\n", |
313 |
– |
progname, npacksdone, nraysdone, (t-starttime)/3600.); |
314 |
– |
fflush(stderr); |
315 |
– |
if (vdef(REPORT)) |
316 |
– |
reporttime = t + (time_t)(vflt(REPORT)*60.+.5); |
317 |
– |
} |
318 |
– |
|
319 |
– |
|
313 |
|
setdefaults(gp) /* set default values */ |
314 |
|
register HDGRID *gp; |
315 |
|
{ |
316 |
|
extern char *atos(); |
317 |
|
register int i; |
318 |
+ |
int n; |
319 |
|
double len[3], maxlen, d; |
320 |
|
char buf[64]; |
321 |
|
|
323 |
|
sprintf(errmsg, "%s must be defined", vnam(SECTION)); |
324 |
|
error(USER, errmsg); |
325 |
|
} |
332 |
– |
if (vdef(SECTION) > 1) { |
333 |
– |
sprintf(errmsg, "ignoring all but first %s", vnam(SECTION)); |
334 |
– |
error(WARNING, errmsg); |
335 |
– |
} |
336 |
– |
if (sscanf(vval(SECTION), |
337 |
– |
"%lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf", |
338 |
– |
&gp->orig[0], &gp->orig[1], &gp->orig[2], |
339 |
– |
&gp->xv[0][0], &gp->xv[0][1], &gp->xv[0][2], |
340 |
– |
&gp->xv[1][0], &gp->xv[1][1], &gp->xv[1][2], |
341 |
– |
&gp->xv[2][0], &gp->xv[2][1], &gp->xv[2][2]) != 12) |
342 |
– |
badvalue(SECTION); |
343 |
– |
maxlen = 0.; |
344 |
– |
for (i = 0; i < 3; i++) |
345 |
– |
if ((len[i] = VLEN(gp->xv[i])) > maxlen) |
346 |
– |
maxlen = len[i]; |
347 |
– |
if (!vdef(GRID)) { |
348 |
– |
sprintf(buf, "%.4f", maxlen/8.); |
349 |
– |
vval(GRID) = savqstr(buf); |
350 |
– |
vdef(GRID)++; |
351 |
– |
} |
352 |
– |
if ((d = vflt(GRID)) <= FTINY) |
353 |
– |
badvalue(GRID); |
354 |
– |
for (i = 0; i < 3; i++) |
355 |
– |
gp->grid[i] = len[i]/d + (1.-FTINY); |
356 |
– |
if (!vdef(EXPOSURE)) { |
357 |
– |
sprintf(errmsg, "%s must be defined", vnam(EXPOSURE)); |
358 |
– |
error(USER, errmsg); |
359 |
– |
} |
360 |
– |
expval = vval(EXPOSURE)[0] == '-' || vval(EXPOSURE)[0] == '+' ? |
361 |
– |
pow(2., vflt(EXPOSURE)) : vflt(EXPOSURE); |
326 |
|
if (!vdef(OCTREE)) { |
327 |
|
if ((vval(OCTREE) = bmalloc(strlen(froot)+5)) == NULL) |
328 |
|
error(SYSTEM, "out of memory"); |
329 |
|
sprintf(vval(OCTREE), "%s.oct", froot); |
330 |
|
vdef(OCTREE)++; |
331 |
|
} |
332 |
< |
if (!vdef(OBSTRUCTIONS)) { |
333 |
< |
vval(OBSTRUCTIONS) = "T"; |
334 |
< |
vdef(OBSTRUCTIONS)++; |
332 |
> |
if (!vdef(VDIST)) { |
333 |
> |
vval(VDIST) = "F"; |
334 |
> |
vdef(VDIST)++; |
335 |
|
} |
372 |
– |
if (!vdef(OCCUPANCY)) { |
373 |
– |
vval(OCCUPANCY) = "U"; |
374 |
– |
vdef(OCCUPANCY)++; |
375 |
– |
} |
336 |
|
/* append rendering options */ |
337 |
|
if (vdef(RENDER)) |
338 |
|
rtargc += wordstring(rtargv+rtargc, vval(RENDER)); |
339 |
+ |
|
340 |
+ |
if (gp == NULL) /* already initialized? */ |
341 |
+ |
return; |
342 |
+ |
/* set grid parameters */ |
343 |
+ |
for (n = 0; n < vdef(SECTION); n++, gp++) { |
344 |
+ |
gp->grid[0] = gp->grid[1] = gp->grid[2] = 0; |
345 |
+ |
if (sscanf(nvalue(SECTION, n), |
346 |
+ |
"%lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %hd %hd %hd", |
347 |
+ |
&gp->orig[0], &gp->orig[1], &gp->orig[2], |
348 |
+ |
&gp->xv[0][0], &gp->xv[0][1], &gp->xv[0][2], |
349 |
+ |
&gp->xv[1][0], &gp->xv[1][1], &gp->xv[1][2], |
350 |
+ |
&gp->xv[2][0], &gp->xv[2][1], &gp->xv[2][2], |
351 |
+ |
&gp->grid[0], &gp->grid[1], &gp->grid[2]) < 12) |
352 |
+ |
badvalue(SECTION); |
353 |
+ |
maxlen = 0.; |
354 |
+ |
for (i = 0; i < 3; i++) |
355 |
+ |
if ((len[i] = VLEN(gp->xv[i])) > maxlen) |
356 |
+ |
maxlen = len[i]; |
357 |
+ |
if (!vdef(GRID)) |
358 |
+ |
d = 0.125*maxlen; |
359 |
+ |
else if ((d = vflt(GRID)) <= FTINY) |
360 |
+ |
badvalue(GRID); |
361 |
+ |
for (i = 0; i < 3; i++) |
362 |
+ |
if (gp->grid[i] <= 0) |
363 |
+ |
gp->grid[i] = len[i]/d + (1.-FTINY); |
364 |
+ |
} |
365 |
|
} |
366 |
|
|
367 |
|
|
369 |
|
HDGRID *gp; |
370 |
|
{ |
371 |
|
extern char VersionID[]; |
372 |
< |
long endloc = 0; |
372 |
> |
int4 lastloc, nextloc; |
373 |
> |
int n; |
374 |
|
int fd; |
375 |
|
FILE *fp; |
376 |
|
/* open & truncate file */ |
384 |
|
printvars(fp); |
385 |
|
fputformat(HOLOFMT, fp); |
386 |
|
fputc('\n', fp); |
387 |
< |
putw(HOLOMAGIC, fp); /* put magic number & terminus */ |
401 |
< |
fwrite(&endloc, sizeof(long), 1, fp); |
387 |
> |
putw(HOLOMAGIC, fp); /* put magic number */ |
388 |
|
fd = dup(fileno(fp)); |
389 |
|
fclose(fp); /* flush and close stdio stream */ |
390 |
< |
hdinit(fd, gp); /* allocate and initialize index */ |
390 |
> |
lastloc = lseek(fd, 0L, 2); |
391 |
> |
for (n = vdef(SECTION); n--; gp++) { /* initialize each section */ |
392 |
> |
nextloc = 0L; |
393 |
> |
write(fd, (char *)&nextloc, sizeof(nextloc)); |
394 |
> |
hdinit(fd, gp); /* writes beam index */ |
395 |
> |
if (!n) |
396 |
> |
break; |
397 |
> |
nextloc = hdfilen(fd); /* write section pointer */ |
398 |
> |
if (lseek(fd, (long)lastloc, 0) < 0) |
399 |
> |
error(SYSTEM, |
400 |
> |
"cannot seek on holodeck file in creatholo"); |
401 |
> |
write(fd, (char *)&nextloc, sizeof(nextloc)); |
402 |
> |
lseek(fd, (long)(lastloc=nextloc), 0); |
403 |
> |
} |
404 |
|
} |
405 |
|
|
406 |
|
|
433 |
|
extern long ftell(); |
434 |
|
FILE *fp; |
435 |
|
int fd; |
436 |
< |
long fpos; |
436 |
> |
int n; |
437 |
> |
int4 nextloc; |
438 |
|
/* open holodeck file */ |
439 |
|
if ((fp = fopen(hdkfile, ncprocs>0 ? "r+" : "r")) == NULL) { |
440 |
|
sprintf(errmsg, "cannot open \"%s\" for %s", hdkfile, |
449 |
|
hdkfile); |
450 |
|
error(USER, errmsg); |
451 |
|
} |
452 |
< |
fread(&fpos, sizeof(long), 1, fp); |
453 |
< |
if (fpos != 0) |
454 |
< |
error(WARNING, "ignoring multiple sections in holodeck file"); |
455 |
< |
fpos = ftell(fp); /* get stdio position */ |
452 |
> |
nextloc = ftell(fp); /* get stdio position */ |
453 |
|
fd = dup(fileno(fp)); |
454 |
|
fclose(fp); /* done with stdio */ |
455 |
< |
lseek(fd, fpos, 0); /* align system file pointer */ |
456 |
< |
hdinit(fd, NULL); /* allocate and load index */ |
455 |
> |
for (n = 0; nextloc > 0L; n++) { /* initialize each section */ |
456 |
> |
lseek(fd, (long)nextloc, 0); |
457 |
> |
read(fd, (char *)&nextloc, sizeof(nextloc)); |
458 |
> |
hdinit(fd, NULL); |
459 |
> |
} |
460 |
> |
if (n != vdef(SECTION)) { |
461 |
> |
sprintf(errmsg, "number of sections does not match %s setting", |
462 |
> |
vnam(SECTION)); |
463 |
> |
error(WARNING, errmsg); |
464 |
> |
} |
465 |
|
} |
466 |
|
|
467 |
|
|
488 |
|
p->next = freepacks; |
489 |
|
freepacks = p; |
490 |
|
} |
491 |
< |
if (n2flush > 512*RPACKSIZ*ncprocs) { |
491 |
> |
if (n2flush > 512*RPACKSIZ*nprocs) { |
492 |
|
hdflush(NULL); /* flush holodeck buffers */ |
493 |
|
n2flush = 0; |
494 |
|
} |
495 |
|
} |
496 |
|
|
497 |
|
|
493 |
– |
getradfile(rfargs) /* run rad and get needed variables */ |
494 |
– |
char *rfargs; |
495 |
– |
{ |
496 |
– |
static short mvar[] = {OCTREE,EXPOSURE,-1}; |
497 |
– |
static char tf1[] = TEMPLATE; |
498 |
– |
char tf2[64]; |
499 |
– |
char combuf[256]; |
500 |
– |
char *pippt; |
501 |
– |
register int i; |
502 |
– |
register char *cp; |
503 |
– |
/* create rad command */ |
504 |
– |
mktemp(tf1); |
505 |
– |
sprintf(tf2, "%s.rif", tf1); |
506 |
– |
sprintf(combuf, |
507 |
– |
"rad -v 0 -s -e -w %s OPTFILE=%s | egrep '^[ \t]*(NOMATCH", |
508 |
– |
rfargs, tf1); |
509 |
– |
cp = combuf; |
510 |
– |
while (*cp){ |
511 |
– |
if (*cp == '|') pippt = cp; |
512 |
– |
cp++; |
513 |
– |
} /* match unset variables */ |
514 |
– |
for (i = 0; mvar[i] >= 0; i++) |
515 |
– |
if (!vdef(mvar[i])) { |
516 |
– |
*cp++ = '|'; |
517 |
– |
strcpy(cp, vnam(mvar[i])); |
518 |
– |
while (*cp) cp++; |
519 |
– |
pippt = NULL; |
520 |
– |
} |
521 |
– |
if (pippt != NULL) |
522 |
– |
strcpy(pippt, "> /dev/null"); /* nothing to match */ |
523 |
– |
else |
524 |
– |
sprintf(cp, ")[ \t]*=' > %s", tf2); |
525 |
– |
if (system(combuf)) { |
526 |
– |
error(SYSTEM, "cannot execute rad command"); |
527 |
– |
unlink(tf2); /* clean up */ |
528 |
– |
unlink(tf1); |
529 |
– |
quit(1); |
530 |
– |
} |
531 |
– |
if (pippt == NULL) { |
532 |
– |
loadvars(tf2); /* load variables */ |
533 |
– |
unlink(tf2); |
534 |
– |
} |
535 |
– |
rtargc += wordfile(rtargv+rtargc, tf1); /* get rtrace options */ |
536 |
– |
unlink(tf1); /* clean up */ |
537 |
– |
} |
538 |
– |
|
539 |
– |
|
498 |
|
rootname(rn, fn) /* remove tail from end of fn */ |
499 |
|
register char *rn, *fn; |
500 |
|
{ |
501 |
|
char *tp, *dp; |
502 |
|
|
503 |
|
for (tp = NULL, dp = rn; *rn = *fn++; rn++) |
504 |
< |
if (ISDIRSEP(*rn)) |
504 |
> |
if (*rn == '/') |
505 |
|
dp = rn; |
506 |
|
else if (*rn == '.') |
507 |
|
tp = rn; |
550 |
|
{ |
551 |
|
int status = 0; |
552 |
|
|
553 |
< |
if (hdlist[0] != NULL) { /* flush holodeck */ |
554 |
< |
if (ncprocs > 0) { |
555 |
< |
done_packets(flush_queue()); |
556 |
< |
status = end_rtrace(); /* close rtrace */ |
557 |
< |
hdflush(NULL); |
558 |
< |
if (vdef(REPORT)) { |
559 |
< |
long fsiz, fuse; |
560 |
< |
report(0); |
603 |
< |
fsiz = hdfilen(hdlist[0]->fd); |
604 |
< |
fuse = hdfiluse(hdlist[0]->fd, 1); |
605 |
< |
fprintf(stderr, |
553 |
> |
if (hdlist[0] != NULL) { /* close holodeck */ |
554 |
> |
if (nprocs > 0) |
555 |
> |
status = done_rtrace(); /* calls hdsync() */ |
556 |
> |
if (ncprocs > 0 && vdef(REPORT)) { |
557 |
> |
long fsiz, fuse; |
558 |
> |
fsiz = hdfilen(hdlist[0]->fd); |
559 |
> |
fuse = hdfiluse(hdlist[0]->fd, 1); |
560 |
> |
fprintf(stderr, |
561 |
|
"%s: %.1f Mbyte holodeck file, %.1f%% fragmentation\n", |
562 |
< |
hdkfile, fsiz/(1024.*1024.), |
563 |
< |
100.*(fsiz-fuse)/fsiz); |
564 |
< |
} |
610 |
< |
} else |
611 |
< |
hdflush(NULL); |
562 |
> |
hdkfile, fsiz/(1024.*1024.), |
563 |
> |
100.*(fsiz-fuse)/fsiz); |
564 |
> |
} |
565 |
|
} |
566 |
|
if (orig_mode >= 0) /* reset holodeck access mode */ |
567 |
|
fchmod(hdlist[0]->fd, orig_mode); |