Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81195 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90745 invoked from network); 27 Jan 2015 03:32:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jan 2015 03:32:18 -0000 Authentication-Results: pb1.pair.com header.from=honey@internot.info; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=honey@internot.info; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain internot.info designates 185.57.82.47 as permitted sender) X-PHP-List-Original-Sender: honey@internot.info X-Host-Fingerprint: 185.57.82.47 mail.internot.info Received: from [185.57.82.47] ([185.57.82.47:47341] helo=mail.internot.info) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 73/61-17708-1C607C45 for ; Mon, 26 Jan 2015 22:32:17 -0500 Message-ID: <54C706B9.3060202@internot.info> Date: Tue, 27 Jan 2015 14:32:09 +1100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 To: internals@lists.php.net References: <1421309087-9479-1-git-send-email-honey@internot.info> <54C6DE40.30904@internot.info> In-Reply-To: <54C6DE40.30904@internot.info> OpenPGP: id=296E6003; url=https://internot.info/docs/gpg_pubkey.asc.gpg Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vKEg2lGR5jE84wRSP4kGuSEcLf0LcqjMW" Subject: Re: [PHP-DEV] [PATCH] Check the return value of do_fstat() to avoid error conditions. From: honey@internot.info (Joshua Rogers) --vKEg2lGR5jE84wRSP4kGuSEcLf0LcqjMW Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 27/01/15 11:39, Joshua Rogers wrote: > if(do_fstat(data, 1)<0) { > return -1; > } This was wrong, anyways. if '1' is returned, the it is OK to continue. If '0' is returned, it is not OK to continue(return -1) Since this is the case, should the do_fstat function be changed to a boolean? It is only possible for it to return 0 and 1: > d->cached_fstat =3D r =3D=3D 0; > > return r; > } > return 0; It makes it confusing when reading the code that it is defined as an int, but the output can only be 0/1. Does anybody object to me changing to from a 'static int', to a 'static zend_bool'? I'll submit a PR, but I would be interested in feedback via the mailing list. Thanks, --=20 -- Joshua Rogers --vKEg2lGR5jE84wRSP4kGuSEcLf0LcqjMW Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJUxwa5AAoJEJCcj5QpbmAD8f0P/1XuhYQC9FsI0FtuFrYodjpv 029yjs+aamT8pwqUUMBQoYe91Nbn3/gziDFS2DJYCrbsTmurRnZVj3AwENe2Cuw5 niijIWVEznrarExsqM3TgWcHJGTKeUS4NIKYzA4xzRU9RL3dTaCAlVNOjjJ4+RE7 5q+s4XsJ/CE6Mx32nHRGvybrCKLABSgnLqtyBrtck0Fd1BY2JlEfzLsfRAlClqyy Jd0cA74KRTQNvjC4BFy4RGAulO5ijYZmfoYBRFXNHloXSFwVXZ5/RbBLALzKXjQz 55NMgxgQzsra5KfYzL7JOHJqtqepeC/MD3cztniNoqc1KScrpER6AKsU26W25CMz 0rPghJz30ZnsArGB5hmRwSgzc8mMg9PqsxDBB1Sp0nj1rG7tGTrGgDhLCeP+1TW2 X8dIcFOetW2A4Hww6yivebcATRG83FYl4/BwaU7DMZSAc1pLNgrj+4qtiTn7do75 zlK0YTjOIWVE8svqZxFchmgPFjp8+EBftOYU/Y9+GfGiT1cWQjVopX+0/zhjI/fJ B30wBzoFPKS+BJyQObgX70OEuY0dQbVu4k/bPfx7cSnK5Fd76AVKktkerFPhixr4 3uw//PKB0Ikcb+0VIKxifWKQs92ke4VTj+f1WOWa2Knomi6BEDevZBfD9+ZJwQfN 3qtEKawC8Z1PvU3/QyZu =w/Q8 -----END PGP SIGNATURE----- --vKEg2lGR5jE84wRSP4kGuSEcLf0LcqjMW--