Date: Mon, 8 Jan 2018 23:17:46 +0700 From: Eugene Grosbein <eugen@grosbein.net> To: Eric van Gyzen <eric@vangyzen.net>, Brooks Davis <brooks@freebsd.org>, Alan Somers <asomers@freebsd.org> Cc: Yuri <yuri@rawbw.com>, Ian Lepore <ian@freebsd.org>, Freebsd hackers list <freebsd-hackers@freebsd.org> Subject: Re: Is it considered to be ok to not check the return code of close(2) in base? Message-ID: <5A5399AA.9020309@grosbein.net> In-Reply-To: <d75e9334-4da1-125c-73a5-1115003d12b5@vangyzen.net> References: <24acbd94-c52f-e71a-8a96-d608a10963c6@rawbw.com> <1514572041.12000.7.camel@freebsd.org> <CAOtMX2jSonHQ9xzVD3Q9XS2twBm_CT3Tquwn%2Bf6zmc7aV0QerQ@mail.gmail.com> <20180105221330.GD95035@spindle.one-eyed-alien.net> <5A4FF989.1040709@grosbein.net> <7b977409-96ee-5acb-60d0-3b0e124495f0@vangyzen.net> <5A5002D9.9080205@grosbein.net> <d75e9334-4da1-125c-73a5-1115003d12b5@vangyzen.net>
next in thread | previous in thread | raw e-mail | index | archive | help
08.01.2018 23:13, Eric van Gyzen wrote: > Right, which is the reason such bugs are hard to diagnose. Optionally > killing the process on close->EBADF would help find buggy code when > another thread did NOT re-open the file descriptor between the two close > calls. Wouldn't "close(f); assert(errno != EBADF);" be better?
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5A5399AA.9020309>