[100] in Pthreads mailing list archive

home help back first fref pref prev next nref lref last post

Re: popen & pclose

daemon@ATHENA.MIT.EDU (Christopher Provenzano)
Sun Aug 27 06:06:50 1995

To: David Bigagli <david@naxos.caspur.it>
Cc: pthreads@MIT.EDU
In-Reply-To: Your message of "Mon, 07 Aug 1995 14:02:46 +0200."
             <9508071202.AA25034@naxos.caspur.it> 
Date: Sun, 27 Aug 1995 05:53:40 EDT
From: Christopher Provenzano  <proven@MIT.EDU>


> 
>  Hi,
>  I have a problem with this simple code:
> 
>   ff = popen("/usr/lib/sendmail -oi -t","w");
>   if(ff == NULL)
>    printf("null pipe %d\n",errno);
> 
>   if(ff != NULL){
>    fprintf(ff,"\
> From: csw client\n\
> To: david\n\
> blablabla\n);
>   }
> 
>   pclose(ff);
> 
>  1)
>  when I'm using it inside a thread after popen I have two
>  processes as I can see using getpid() and both are waiting
>  on pclose(ff).
> 
>  2)
>  If I only include and link this program with pthreads without
>  using any thread the programs stops and wait on pclose(ff).
> 
>  Any idea??

This actually triggered two bugs. One in the pclose(), where the file
descriptor wasn't closed until after the call to wait(), and the second
was in the signal handler where signals with default signal handlers
were causing the thread to spin. Both will be fixed in beta4.

CAP

home help back first fref pref prev next nref lref last post