static void err_fatal_errno( const char *routine, const char *format, ... ) { va_list ap; int errorno = errno; fflush( stdout ); if (_err_programName) { if (routine) fprintf( stderr, "%s (%s): ", _err_programName, routine ); else fprintf( stderr, "%s: ", _err_programName ); } else { if (routine) fprintf( stderr, "%s: ", routine ); } va_start( ap, format ); vfprintf( stderr, format, ap ); log_error_va( routine, format, ap ); va_end( ap ); #if HAVE_STRERROR fprintf( stderr, "%s: %s\n", routine, strerror( errorno ) ); log_error( routine, "%s: %s\n", routine, strerror( errorno ) ); #else errno = errorno; perror( routine ); log_error( routine, "%s: errno = %d\n", routine, errorno ); #endif fflush( stderr ); fflush( stdout ); exit( 1 ); }
void err_warning( const char *routine, const char *format, ... ) { va_list ap; fflush( stdout ); fflush( stderr ); if (_err_programName) { if (routine) fprintf( stderr, "%s (%s): ", _err_programName, routine ); else fprintf( stderr, "%s: ", _err_programName ); } else { if (routine) fprintf( stderr, "%s: ", routine ); } va_start( ap, format ); vfprintf( stderr, format, ap ); log_error_va( routine, format, ap ); va_end( ap ); }