apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gonzalo Paniagua Javier <gonzal...@gmail.com>
Subject Re: apr_proc_create hangs on 'modprobe -c'
Date Wed, 03 Aug 2005 23:37:09 GMT
On 8/3/05, Nicholas Merryman <nmerrym@us.ibm.com> wrote:
[...]
> // wait for child to finish or die 
> apr_proc_wait(&hChild,&exitStatus,&exitWhy,APR_WAIT); 
>  
> if (!APR_PROC_CHECK_EXIT(exitWhy)) { 
>      cout<<"ERROR: SpawnProcess - child terminated abnormally"; 
> } 
>  
> output = GetFileContents(hChild.out);  //read contents of child's output 

The output from 'modprobe -c' can be quite verbose and if you're not
reading the output generated and the pipe reaches some limit, the
writing side of the pipe will block until someone reads from it.

A possible solution is to read from hChild.out until it's closed (0 read).

-Gonzalo

Mime
View raw message