On Fri, Apr 28, 2006 at 03:27:39AM +0200, Michael Kerrisk wrote: > Justin, > > Comments below: > > > Included is a manpage for error(). Please consider including it. > > I am considering it. > > > .TH ERROR 3 "25 April 2006" GNU > > .\" Please adjust this date whenever revising the manpage. > > No need for that last line. It was in the Debian manpage template :)
> > .SH DESCRIPTION > > \fBerror\fP > > For functions, write with "()", thus "error()". > Please read my HOWTOHELP doc, which points you at > fcntl.2 as an example of how things should be done. Ah, I've read it before but am rereading it now. > > \fIerror_message_count\fP is the count of times that > > \fBerror\fP has been called. > > Actually counts number of messages printed. This probably is more clear, though the ambiguity in documentation should be noted. > > This variable can be used to defer and > > unify error handling for a large code block to a single common > > handler. > > I'm not sure what you are meaning with the above. Please explain. I think I got this idea from the glibc example program. Consider ferror(), which allows you to do a whole bunch of stuff on a FILE* without checking individual function calls for error, and then test whether they all succeeded with ferror(), and handle it at once. error() can do the same thing, kind of. You still have to do some kind of conditionals around the function calls, but you can do the more elaborate error message in one place. I guess you can do this anyway with a custom any_err=0, but I was trying to preserve the interesting usage example. It could be omitted. > > If \fIerror_print_progname\fP is set nonnull, then it is called > > instead of prefixing the message with the program name and colon. > > > Note that when \fIerror_print_progname\fP is unset, \fIstdout\fP is > > cleared before printing to \fIstderr\fP. > > Where so you glean this piece of information from? The header file, /usr/include/error.h. Should I send a tweaked manpage? Justin -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]