- if (!resolver) {
- sysassert(! pipe(jobpipe) );
- sysassert(! pipe(donepipe) );
- resolver_pid= fork();
- sysassert(resolver_pid!=-1);
- if (!resolver_pid) {
- sysassert( dup2(jobpipe[0],0) ==0 );
- sysassert(! close(jobpipe[1]) );
- sysassert(! close(donepipe[0]) );
- /* we know donepipe[1] is >= 4 and we have dealt with all the others
- * so we aren't in any danger of overwriting some other fd 4: */
- sysassert( dup2(donepipe[1],4) ==4 );
- execlp("./yppsc-ocr-resolver", "yppsc-ocr-resolver",
- DEBUGP(callout) ? "--debug" : "--noop-arg",
- "--automatic-1",
- (char*)0);
- sysassert(!"execlp failed");
- }
- sysassert(! close(jobpipe[0]) );
- sysassert(! close(donepipe[1]) );
- resolver= fdopen(jobpipe[1],"w"); sysassert(resolver);
- resolver_done= donepipe[0];
- }
- fprintf(resolver,"%d %d ",unk_l,unk_r);
- cu_pr_ctxmap(unk_ctxmap);