X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Ferror.c;h=2508ea841b8da4e01a7332a51722677e93903fbe;hb=799b98ef9a6e8ddb5b17a056433ee2018329de26;hp=b1bbf1853d989d035fb599623875afaad321bd60;hpb=1f0862026427d4447e997f04238d1df635ef09f3;p=gnulib.git diff --git a/lib/error.c b/lib/error.c index b1bbf1853..2508ea841 100644 --- a/lib/error.c +++ b/lib/error.c @@ -1,5 +1,5 @@ /* error.c -- error handler for noninteractive utilities - Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc. + Copyright (C) 1990, 91, 92, 93, 94, 95 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -43,6 +43,9 @@ void exit (); #endif +/* This variable is incremented each time `error' is called. */ +unsigned int error_message_count; + /* If NULL, error will flush stdout, then print on stderr the program name, a colon and a space. Otherwise, error will call this function without parameters instead. */ @@ -53,7 +56,7 @@ void (*error_print_progname) () = NULL; extern char *program_name; #if HAVE_STRERROR -# ifndef strerror /* On some systems, sterror is a macro */ +# ifndef strerror /* On some systems, strerror is a macro */ char *strerror (); # endif #else @@ -112,6 +115,8 @@ error (status, errnum, message, va_alist) fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8); #endif + ++error_message_count; + if (errnum) fprintf (stderr, ": %s", strerror (errnum)); putc ('\n', stderr);