Fwd: kprocess - close all open files in the child

Malte Starostik malte at kde.org
Thu Dec 19 10:30:55 GMT 2002


On Wednesday 18 December 2002 23:53, Carsten Pfeiffer wrote:
> ----------  Forwarded Message  ----------
>
> Subject: kprocess - close all open files in the child
> Date: Wednesday 18 December 2002 09:17
> From: Klaus-Dieter Krannich <kd at Math.TU-Cottbus.DE>
> To: kde-devel at kde.org
>
> Hi all,
>
> Sometimes it is necessary to have additonal (beside stdin/stdout/stderr)
> communication channels between the caller and the child. In traditional
> GUI programming this is often done by opening a pipe/socketpair in the
> caller and passing a filedescriptor via commandline args to the child.
> The recently added 'close all open files in the child after the fork'
> feature in kprocess makes such an approach impossible. It would be
> really nice, if this behaviour was the default, but could be turned off
> by an appropriate flag at construction time.

IMHO it should also be possible to have a finer control, like the possibility 
to specify a list of fds that should be excempt from closing.
Also it's a bad that stdin/out/err are closed because this completely disables 
one to see debug output from an app started via kprocess :-(

> BTW, "Xterm started from minicli really doesn't need to have the ksycoca
> file open" is a weak argument w.r.t. the 'brute force' loop over all
> possible fd's. Wouldn't it be better to fix minicli ? :-)

ACK.

-Malte
-- 
short circuit; auto accident; static electricity; struct by_lightning;
double trouble; unsigned long letter; float valve; short pants; void check;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: signature
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20021219/d8fed44a/attachment.sig>


More information about the kde-core-devel mailing list