From kde-core-devel Sun Nov 10 08:11:25 2013 From: Rolf Eike Beer Date: Sun, 10 Nov 2013 08:11:25 +0000 To: kde-core-devel Subject: Re: Review Request 113779: KInfocenter/OpenGL: fix ReadPipe() in the case that the command cannot be Message-Id: <23883771.EPg94Fv4BY () caliban ! sf-tec ! de> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=138407113011843 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--nextPart3711333.cWxElK0fU6" --nextPart3711333.cWxElK0fU6 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" > ReadPipe() doesn't return 0 as expected in the case that the command is not > found. but the length of sh's output which is "command not found" in this > case. This is because popen() does not fail if the command is not found, > because it _can_ run "sh". (according to the man page, popen calls "/bin/sh > -c command") To fix this, ReadPipe() should check the return code of the > call to pclose() (see "man pclose"), and return 0 if this is not equal to > 0. Can't this be ported to simply use QProcess instead? Eike --nextPart3711333.cWxElK0fU6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iEYEABECAAYFAlJ/P7UACgkQXKSJPmm5/E4zGQCgjt57CyVtuoibzl+KC90qYNK+ VLcAn1QUAYWY0AkQjJc/rLEKibi13fvO =k0Nq -----END PGP SIGNATURE----- --nextPart3711333.cWxElK0fU6--