Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 01 Jan 2018 10:07:20 +0000
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        Mark Millard <markmi@dsl-only.net>
Cc:        "Rodney W. Grimes" <freebsd-rwg@pdx.rh.CN85.dnsmgr.net>, FreeBSD Hackers <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:  <69801.1514801240@critter.freebsd.dk>
In-Reply-To: <5AD2D86A-2515-4D4D-91B2-1919531F7CC3@dsl-only.net>
References:  <201801010305.w0135luG084158@pdx.rh.CN85.dnsmgr.net> <559541DD-3287-4473-B7DE-B4DDC6860DF7@dsl-only.net> <5AD2D86A-2515-4D4D-91B2-1919531F7CC3@dsl-only.net>

next in thread | previous in thread | raw e-mail | index | archive | help
--------
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=
.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69801.1514801240>