merge with 1.11.1a
[gnulib.git] / lib / error.c
index b1bbf18..a65d644 100644 (file)
@@ -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);