From owner-freebsd-hackers@freebsd.org Mon Jan 1 10:07:38 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B97D1EA1995 for ; Mon, 1 Jan 2018 10:07:38 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 811676713C for ; Mon, 1 Jan 2018 10:07:37 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.55.3]) by phk.freebsd.dk (Postfix) with ESMTP id AC88E27395; Mon, 1 Jan 2018 10:07:36 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTPS id w01A7KY0069803 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 1 Jan 2018 10:07:21 GMT (envelope-from phk@critter.freebsd.dk) Received: (from phk@localhost) by critter.freebsd.dk (8.15.2/8.15.2/Submit) id w01A7KJU069802; Mon, 1 Jan 2018 10:07:20 GMT (envelope-from phk) To: Mark Millard cc: "Rodney W. Grimes" , FreeBSD Hackers Subject: Re: Is it considered to be ok to not check the return code of close(2) in base? In-reply-to: <5AD2D86A-2515-4D4D-91B2-1919531F7CC3@dsl-only.net> From: "Poul-Henning Kamp" References: <201801010305.w0135luG084158@pdx.rh.CN85.dnsmgr.net> <559541DD-3287-4473-B7DE-B4DDC6860DF7@dsl-only.net> <5AD2D86A-2515-4D4D-91B2-1919531F7CC3@dsl-only.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <69800.1514801240.1@critter.freebsd.dk> Content-Transfer-Encoding: quoted-printable Date: Mon, 01 Jan 2018 10:07:20 +0000 Message-ID: <69801.1514801240@critter.freebsd.dk> X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jan 2018 10:07:38 -0000 -------- In message <5AD2D86A-2515-4D4D-91B2-1919531F7CC3@dsl-only.net>, Mark Milla= rd wr ites: >asserts that call abort are difficult to >guarantee specific program-exit behavior >for, based on just the standards anyway. One should read "assert" in a source code as a curse along the lines of "Strike me by lightning if this is not true!" If you want more gentle behaviour you should implement proper errorhandlin= g. But for all the places where you think "Nahh ... that's never going to happen", you should document your decision with assert(). -- = Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe = Never attribute to malice what can adequately be explained by incompetence= .