[LCP]Fork freezes when forking more then one

juman juman at chello.se
Tue Aug 26 08:31:01 UTC 2003


On Mon, Aug 25, 2003 at 06:47:00PM -0500, Steve Baker wrote:
> > Before reading from child I close as
> > close(run->pc[OUTPUT]);
> 
>   Why do you do that?  It isn't necessary, and if the program is wanting more
> input for some reason, it will likely die at the point it tries to read more
> data (broken pipe).
> 

If I the software will stop when trying to read from the child...? I
also thought this was strange and that you should be able to read/write
to the child in sequences...

>   I'm curious as to what the test.awk script does, does it possibly need a
> '\n' after the filename you give it, so perhaps you should be sending:
> 
>   write_to_child (b, "testa.mp3\n");
> 

That is true that the line should end with a \n to be processed by the
awk script that looks like :

#!/bin/awk -f
/\.[mM][pP]3/ {print $0}

But changing the software to send \n to the child I still have to close
the run->pc[OUTPUT] to be able to read anything at all... If I try to
read without doing that the software hangs...



More information about the linuxCprogramming mailing list