KProcess: writeStdin API braindamage

Waldo Bastian bastian at kde.org
Tue Mar 23 17:30:18 GMT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue March 23 2004 16:54, Oswald Buddenhagen wrote:
> On Tue, Mar 23, 2004 at 04:48:27PM +0100, Waldo Bastian wrote:
> > Now that KProcess creates non-blocking pipes to its child processes
>
> [again]
>
> > it becomes clear that the semantics of the writeStdin function are
> > brain dead:
>
> guess why i want to merge kprocio into kprocess ...
>
> > hardly any caller makes sure that the data that was passed stays alive
> > long enough (t.i. till a wroteStdin signal arrives)
> >
> > This patches corrects that, by making a local copy of the data if the
> > data could not be directly written into the pipe. This fixes pasting
> > large amounts of data into konsole.
>
> i don't like it. the behaviour is clearly documented; working around
> usage errors will certainly lead to other problems. fix the apps
> instead.

It's a pain to work around and much more efficient to do it in kprocess.
It's simply a very unintuitive restriction on the API and as the patch shows, 
it can be easily solved.

Cheers,
Waldo
- -- 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
^ bastian at kde.org | Is your software SUSE LINUX READY? | bastian at suse.com
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFAYHQrN4pvrENfboIRAp8RAJ0SO08Rs8Sp52JzHx13tXXETsgs9gCfY88n
do4cxrpBTmhQbpkm/vtQgMY=
=JZ6Y
-----END PGP SIGNATURE-----




More information about the kde-core-devel mailing list