1 /* error.c - functions to signal error conditions 2 * 3 * Copyright 1999 Jochen Voss */ 4 5 static const char rcsid[] = "$Id: error.c 4839 2003-04-13 16:50:02Z voss $"; 6 7 #ifdef HAVE_CONFIG_H 8 #include <config.h> 9 #endif 10 11 #include <stdio.h> 12 #include <stdlib.h> 13 #include <stdarg.h> 14 #include <ctype.h> 15 #include <unistd.h> 16 17 #include "moon-buggy.h" 18 19 20 void fatal(const char * format,...)21fatal (const char *format, ...) 22 /* Signal a fatal error and quit immediately. The arguments have the 23 * same meaning, as in the function `printf'. 24 * The message should start with a capital letter. */ 25 { 26 va_list ap; 27 28 prepare_for_exit (); 29 30 va_start (ap, format); 31 fflush (NULL); 32 fputs ("Fatal error: ", stderr); 33 vfprintf (stderr, format, ap); 34 fputc ('\n', stderr); 35 va_end (ap); 36 37 exit (EXIT_FAILURE); 38 } 39