From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755329AbbLXRzL (ORCPT ); Thu, 24 Dec 2015 12:55:11 -0500 Received: from mout.web.de ([212.227.17.11]:53017 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752326AbbLXRzH (ORCPT ); Thu, 24 Dec 2015 12:55:07 -0500 Subject: Re: Documentation-getdelays: Fix a check for container file usage in main() To: Jonathan Corbet References: <566ABCD9.1060404@users.sourceforge.net> <567BE5AA.6070607@users.sourceforge.net> <567BE64C.4090604@users.sourceforge.net> <20151224072210.15d6ee6c@lwn.net> Cc: linux-doc@vger.kernel.org, LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring X-Enigmail-Draft-Status: N1110 Message-ID: <567C316A.6020406@users.sourceforge.net> Date: Thu, 24 Dec 2015 18:54:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20151224072210.15d6ee6c@lwn.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:KfyXwdyf35HJt4k8S2124GFlAJPystn/oJhne8svb0tBurVBERG 4FuvFC/zVD7Ece56DAtV+HJZ7Ygm77J2HNkFT3epPABkQjRV706zkhsH7hhriD3Vi3EgSXI 1NBag/bSFMLekdHaNQdTEUgX+N6q2qm3ArWLcE4YvEaP1rTO0VUZ/RDw+vTSD4kZloUp+6k hVnZY396nULzVyDYmM3pg== X-UI-Out-Filterresults: notjunk:1;V01:K0:fCI9I/BQpeE=:p82L912nJZLwzN5WdVGoiI 9DT68XQ3vCyy5y/7cpVZCi2LLObxXfU4QXsX9ZbMo1pBIl2Fr/ttiYef9gE8geZscDJDQs7Oo Z1KuHSjRLMfFvqQavUiS1txaBOyyL8YJkwQjMqJBOunF381dapY6B34SIBeK3LwuCFmmP1ct1 g3O+3LMQTREr/Fv2bT0Lf6PptB3FPmlCDSOSEokYEgPxnv0KSJOLMMlP/uTQSdwhYOCs6EnZv qUNiGFmHRcEf7IjR/18nQDU3SAdKvYbnCRK1EJYiF+NhLKIQHZpJ2N1ipOiByA8fI1Of6dQ0d 3sok/xZSJCeCe8I5P7iw8p6dHJq7ihd91OoPWzUHSgMC0adF1VnaZMGDNVDkSYxPdOae6jMP/ 2PCr/Juvuy4BxoFMk1X5NlMe6HiEic3OVghN5+c0zLJvmMTT9lx2FUhjhT1CHM8GGS5i0Ke8W DtXKSzVnW7kAIktzCYf3YgaaAtQprxm0vUQbXd+UdyNbzXHZ7eaE6+7kxisu91Ao+A3ESx6Pt 3TmuBLN5gz4Yxbmj69DKe5IoC8tCogL+eOHdeLPRcSb3mYsnLXjpC3f66E68yfyavMr8hPNN9 0D9YVZO6xUrH48Ahp4XadTjMD3XvYqCUhcKXWfzXDjElygRAiLUEvQCiaS5wiB08ghTtm41sd Rdk18TDXDw1SXaIWDDNQ1Sef1O8t/v1ZU7Ue2qRI+knIVPwzLk2WJN0RqKuv/fIhBvvg10hxm AUV0I669UsB8L1UU1XI0NZXCfWHILHM8lSSQZ1OUzIl2QhwDJlF8ZBNXpjo62a76i+HnPeMle CUlG1Yk Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> The close() function could be called by the main() function even if >> the passed variable "cfd" was assigned a negative value. … > This seems more easily fixed by simply making the condition > 0. How do you think about the reuse of the error predicate "cfd != -1" for the return value from a call of the function "open"? http://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/Documentation/accounting/getdelays.c?id=80c75a0f1d81922bf322c0634d1e1a15825a89e6#n425 > Meanwhile, I'd really not add labels-inside-if-statements as an example > in the documentation tree. How are the chances to improve the affected error detection and corresponding exception handling? Regards, Markus