Subject: Re: Sane exit from a program on receipt of a signal
To: Christos Zoulas <>
From: David Laight <>
List: tech-userlevel
Date: 09/24/2007 21:21:37
On Mon, Sep 24, 2007 at 11:32:11AM -0400, Christos Zoulas wrote:
> Looks good to me. I would only cast the result of memset() to (void)
> to shut-up lint.

And I wouldn't because I find those casts make teh code more difficult
to read.

The worst one is the result of fprintf(), where people are likely to
start adding code to check for it returning -1 (as was done to config).
This was all pointless (and removed) since any 'write error' is very
unlikely to be reported until fflush() or fclose() is called.
Write errors can be detected by the fflush(); ferror(); fclose(); sequence.


David Laight: