| 587 |
|
#endif |
| 588 |
|
octname == NULL) |
| 589 |
|
error(USER, "missing octree argument"); |
| 590 |
+ |
/* set up output */ |
| 591 |
|
#ifdef PERSIST |
| 592 |
|
if (persist) { |
| 593 |
|
#if RPICT |
| 594 |
< |
if (outfile != NULL | zfile != NULL | recover != NULL) |
| 595 |
< |
error(USER, "persist option used with -o, -r or -z"); |
| 594 |
> |
if (recover != NULL) |
| 595 |
> |
error(USER, "persist option used with recover file"); |
| 596 |
|
if (seqstart <= 0) |
| 597 |
|
error(USER, "persist option only for sequences"); |
| 598 |
+ |
if (outfile == NULL) |
| 599 |
|
#endif |
| 600 |
|
duped1 = dup(fileno(stdout)); /* don't lose our output */ |
| 601 |
|
openheader(); |
| 602 |
|
} |
| 603 |
< |
#endif |
| 603 |
> |
#else |
| 604 |
|
#if RPICT |
| 605 |
|
if (outfile != NULL) |
| 606 |
|
openheader(); |
| 607 |
|
#endif |
| 608 |
+ |
#endif |
| 609 |
|
#ifdef MSDOS |
| 610 |
|
#if RTRACE |
| 611 |
|
if (outform != 'a') |
| 632 |
|
|
| 633 |
|
#ifdef PERSIST |
| 634 |
|
if (persist) { |
| 635 |
< |
fflush(stdout); /* reconnect stdout */ |
| 636 |
< |
dup2(duped1, fileno(stdout)); |
| 637 |
< |
close(duped1); |
| 635 |
> |
fflush(stdout); |
| 636 |
> |
if (outfile == NULL) { /* reconnect stdout */ |
| 637 |
> |
dup2(duped1, fileno(stdout)); |
| 638 |
> |
close(duped1); |
| 639 |
> |
} |
| 640 |
|
if (persist == 2) { /* multiprocessing */ |
| 641 |
|
preload_objs(); /* preload scene */ |
| 642 |
|
while ((rval=fork()) == 0) { /* keep on forkin' */ |
| 648 |
|
error(SYSTEM, "cannot fork child for persist function"); |
| 649 |
|
pfdetach(); |
| 650 |
|
persist = 0; /* parent shan't persist */ |
| 651 |
+ |
if (outfile == NULL) |
| 652 |
+ |
dupheader(); |
| 653 |
+ |
else /* keep open so attach waits */ |
| 654 |
+ |
duped1 = dup(fileno(stdout)); |
| 655 |
|
} |
| 647 |
– |
dupheader(); |
| 656 |
|
} |
| 657 |
|
runagain: |
| 658 |
+ |
if (persist && outfile == NULL) |
| 659 |
+ |
dupheader(); |
| 660 |
|
#endif |
| 661 |
|
#if RPICT |
| 662 |
|
rpict(seqstart, outfile, zfile, recover); |
| 684 |
|
pfhold(); |
| 685 |
|
tstart = time(0); /* reinitialize counters */ |
| 686 |
|
raynum = nrays = 0; |
| 677 |
– |
dupheader(); /* reproduce header */ |
| 687 |
|
goto runagain; |
| 688 |
|
} |
| 689 |
|
#endif |