265 |
|
} |
266 |
|
|
267 |
|
|
268 |
< |
/* Start child processes if we can */ |
268 |
> |
/* Start child processes if we can (call only once in parent!) */ |
269 |
|
int |
270 |
|
in_rchild() |
271 |
|
{ |
303 |
|
kida[nchild].infp = fdopen(kida[nchild].pr.r, "rb"); |
304 |
|
if (kida[nchild].infp == NULL) |
305 |
|
error(SYSTEM, "out of memory in in_rchild()"); |
306 |
– |
#if 0 |
307 |
– |
flockfile(kida[nchild].infp); /* avoid mutex overhead */ |
308 |
– |
#endif |
306 |
|
kida[nchild++].nr = 0; /* mark as available */ |
307 |
|
} |
308 |
+ |
#ifdef getc_unlocked |
309 |
+ |
for (rval = nchild; rval--; ) /* avoid mutex overhead */ |
310 |
+ |
flockfile(kida[rval].infp); |
311 |
+ |
#endif |
312 |
|
return(0); /* return "false" in parent */ |
313 |
|
} |
314 |
|
|