Re: children not getting eof from pipe
- From: xhoster@xxxxxxxxx
- Date: 20 Jun 2005 16:57:33 GMT
Jim Gibson <jgibson@xxxxxxxxxxxxxxxxx> wrote:
> In article <1119238835.726861.273020@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
> <kspecial@xxxxxxxxxxxxx> wrote:
> >
> > $oldpid = $$;
> > for (undef($num); $num < $forks; $num++) {
> > $read = $fd[$num][0];
> > $write = $fd[$num][1];
> > if (fork) { close($read); } else { close($write); last; }
> > }
> >
....
> > }
> > else {
> > while(!(eof($read))) {
> > my $data = readline($read);
>
> The value of $read here is incorrect except for the last child. All
> children are reading from the same pipe, the last one created.
It is hard to tell from the weird code, but it does look like each
child has a different $read at the time they "last" out of the for
loop.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
.
- Follow-Ups:
- Re: children not getting eof from pipe
- From: kspecial
- Re: children not getting eof from pipe
- From: kspecial
- Re: children not getting eof from pipe
- References:
- children not getting eof from pipe
- From: kspecial
- Re: children not getting eof from pipe
- From: Jim Gibson
- children not getting eof from pipe
- Prev by Date: Re: Net::Telnet and SMTP
- Next by Date: Re: Q for the old-timers: antecedents to the ST?
- Previous by thread: Re: children not getting eof from pipe
- Next by thread: Re: children not getting eof from pipe
- Index(es):
Relevant Pages
|
|