bot403 has asked for the wisdom of the Perl Monks concerning the following question:
I found that if it doesn't read any data I read 0 bytes from INPIPE. It could be that the reader will give me 0 bytes in a normal situation so I can't use the amount of data to determine success or not. Since the reader program was found but had some other error the die isn't triggered either. Is there any other way than SIGCHLD to get the reader's RC or know if it failed? Any other tricky ways I can infer if it failed or completed successfully? Stderr has to be left alone to be collected outside of my perl script. Any one have any experience working around broken SIGCHLD behavior?open(INPIPE,"$reader_prog $options |") or die('Cant open reader'); while($bytes = read(INPIPE,$buffer,32768)){ print $buffer; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Children and return codes
by pc88mxer (Vicar) on Jan 10, 2008 at 23:23 UTC | |
|
Re: Children and return codes
by bot403 (Beadle) on Jan 11, 2008 at 15:11 UTC |