472 |
|
oconv(void) /* run oconv and mkillum if necessary */ |
473 |
|
{ |
474 |
|
static char illumtmp[] = "ilXXXXXX"; |
475 |
< |
char combuf[PATH_MAX], ocopts[64], mkopts[64]; |
475 |
> |
char combuf[PATH_MAX], ocopts[64], mkopts[1024]; |
476 |
|
|
477 |
|
oconvopts(ocopts); /* get options */ |
478 |
|
if (octreedate < scenedate) { /* check date on original octree */ |
599 |
|
|
600 |
|
static void |
601 |
|
mkillumopts( /* get mkillum options */ |
602 |
< |
register char *mo |
602 |
> |
char *mo |
603 |
|
) |
604 |
|
{ |
605 |
|
/* BEWARE: This may be called via setdefaults(), so no assumptions */ |
606 |
|
|
607 |
< |
*mo = '\0'; |
607 |
> |
if (nprocs > 1) { |
608 |
> |
sprintf(mo, " -n %d", nprocs); |
609 |
> |
while (*mo) |
610 |
> |
mo++; |
611 |
> |
} else |
612 |
> |
*mo = '\0'; |
613 |
|
if (vdef(MKILLUM)) |
614 |
|
addarg(mo, vval(MKILLUM)); |
615 |
|
} |
1145 |
|
VIEW vwr; |
1146 |
|
char buf[128]; |
1147 |
|
register char *cp; |
1148 |
+ |
#ifdef _WIN32 |
1149 |
+ |
/* XXX Should we allow something like this for all platforms? */ |
1150 |
+ |
/* XXX Or is it still required at all? */ |
1151 |
+ |
again: |
1152 |
+ |
#endif |
1153 |
|
if (vopts == NULL) |
1154 |
|
return(-1); |
1155 |
|
#ifdef _WIN32 |
1322 |
|
/* rpict persistent mode */ |
1323 |
|
if (!silent) |
1324 |
|
printf("\t%s\n", combuf); |
1325 |
+ |
fflush(stdout); |
1326 |
|
sprintf(combuf, "rpict%s %s %s%s%s %s > %s", |
1327 |
|
rep, rppopt, res, po, opts, |
1328 |
|
oct1name, rawfile); |
1318 |
– |
fflush(stdout); |
1329 |
|
fp = popen(combuf, "w"); |
1330 |
|
if (fp == NULL) |
1331 |
|
goto rperror; |
1363 |
|
} |
1364 |
|
wait_process(1); /* wait for children to finish */ |
1365 |
|
if (pfile != NULL) { /* clean up rpict persistent mode */ |
1366 |
< |
int pid; |
1366 |
> |
RT_PID pid; |
1367 |
|
fp = fopen(pfile, "r"); |
1368 |
|
if (fp != NULL) { |
1369 |
|
if (fscanf(fp, "%*s %d", &pid) != 1 || |
1406 |
|
printf("\t%s\n", cs); |
1407 |
|
if (!nprocs) |
1408 |
|
return(0); |
1409 |
< |
fflush(stdout); /* flush output and pass to shell */ |
1409 |
> |
fflush(NULL); /* flush output and pass to shell */ |
1410 |
|
return(system(cs)); |
1411 |
|
} |
1412 |
|
|
1442 |
|
static int |
1443 |
|
next_process(void) /* fork the next process (max. nprocs) */ |
1444 |
|
{ |
1445 |
< |
int child_pid; |
1445 |
> |
RT_PID child_pid; |
1446 |
|
|
1447 |
|
if (nprocs <= 1) |
1448 |
|
return(0); /* it's us or no one */ |
1453 |
|
} |
1454 |
|
if (children_running >= nprocs) |
1455 |
|
wait_process(0); /* wait for someone to finish */ |
1456 |
< |
fflush(stdout); |
1456 |
> |
fflush(NULL); /* flush output */ |
1457 |
|
child_pid = fork(); /* split process */ |
1458 |
|
if (child_pid == 0) { /* we're the child */ |
1459 |
|
children_running = -1; |
1473 |
|
) |
1474 |
|
{ |
1475 |
|
int ourstatus = 0; |
1476 |
< |
int pid, status; |
1476 |
> |
RT_PID pid, status; |
1477 |
|
|
1478 |
|
if (all) |
1479 |
|
all = children_running; |
1510 |
|
} |
1511 |
|
int |
1512 |
|
kill(pid, sig) /* win|unix_process.c should also wait and kill */ |
1513 |
< |
int pid, sig; |
1513 |
> |
RT_PID pid, sig; |
1514 |
|
{ |
1515 |
|
return 0; |
1516 |
|
} |