X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Ferror.c;h=a65d644d1bca69cfb9628864bea8f85bc1015dc8;hb=c89f48f01f6047b50c1ed3c981901f620ec98f6a;hp=b1bbf1853d989d035fb599623875afaad321bd60;hpb=1f0862026427d4447e997f04238d1df635ef09f3;p=gnulib.git diff --git a/lib/error.c b/lib/error.c index b1bbf1853..a65d644d1 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. */ @@ -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);