[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: KProcess eats SIGCHLD, so pclose() fails
From:       Lubos Lunak <l.lunak () sh ! cvut ! cz>
Date:       2001-11-30 15:34:34
[Download RAW message or body]


On Fri 30. November 2001 14:47, David Faure wrote:
> On Thursday 29 November 2001 21:01, Luis Pedro Coelho wrote:
> > Em Quarta, 28 de Novembro de 2001 21:18, David Faure escreveu:
> > > On Wednesday 28 November 2001 20:28, aleXXX wrote:
> > > > On Wed 28 Nov 01 18:32, David Faure wrote:
> > > > > KProcessController, instantiated by KProcess, seems to grab all
> > > > > SIGCHLD events, even the ones that have nothing to do with
> > > > > KProcess.
> > > >
> > > > After looking at the code, it grabs exactly SIGCHLD and SIGPIPE since
> > > > it has to know when its child dies.
> > >
> > > Yes, but maybe there's a way to tell it to ignore a certain pid, or to
> > > forward unknown signals, or...
> >
> > I think this is impossible to do correctly.
>
> Lubos Lunak (a very clever man;) came up with a patch that fixes this.

 Apparently no clever enough, I missed that post.

> Not committed yet, under discussion with Waldo.
> I ported my kde-2.2.2 code to KProcIO, works great. But it's good to know
> that KDE-3 programs will be able to use libraries that use popen/pclose
> without trouble.

 You're right, signal handlers suck. Anyway, since I've already written it, 
the attached patch should make it work as good as possible. popen() works 
with it, so be sane and use KProcess/KProcIO whenever possible.

-- 
 Lubos Lunak
 llunak@suse.cz ; l.lunak@kde.org
 http://dforce.sh.cvut.cz/~seli

["kprocess.tar.bz2" (application/x-bzip2)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic