pclose hangs

Olav Eide olav at nososl.UUCP
Thu Aug 2 19:59:11 AEST 1990


I have a problems that I hope some of the experts out there can help me with.

I open a pipe, and read data from the file descriptor returned by the
popen call. The problem occurs when I attempt to close the pipe after
having finished reading. The program then hangs in the pclose call
and nothing happens until I kill the program.

Basically what I have is this :

            if (( fd = popen("process1 | process2","r")) == NULL)
	             exit(-1); /*  Broken pipe */

            while ( fgets(line,255,fd)) {
	               .
	              /* various stuff */
						     .
            }

           pclose(fd); /* And this is where it hangs */

It appears that it hangs in a call to sigsetmask.

Can anyone enlighten me ??

PS. We're running Integrated Solutions 4.3BSB

Thanks.



More information about the Comp.lang.c mailing list