On Wed, Jun 11, 2014 at 10:53:35AM +0800, Ruoyu wrote: > Sometimes sheep process cannot exit as we expected. I think the > point might be the sequential problem by using waitpid, the > system call waiting for process to change state. > > Current log_close function calling waitpid as a void method. It > will block the main process. Suppose this situation: > > Father: --> active=false --------------------------------> waitpid > Child: -------------> active=true --> while(active) do sth. --> > > The log process will loop forever so that the main process cannot > exit. > > Therefore, it is better to retrieve the return value and pass the > nonblocking flag WNOHANG to it. Moreover, reset share memory flag > before each time calling waitpid. > > Signed-off-by: Ruoyu <lian...@ucweb.com> > ---
Applied thanks Yuan -- sheepdog mailing list sheepdog@lists.wpkg.org http://lists.wpkg.org/mailman/listinfo/sheepdog