2 * Routines to report various classes of problems. Each report is decorated
3 * with the current context (file name and line number), if available.
5 * tcpd_warn() reports a problem and proceeds.
7 * tcpd_jump() reports a problem and jumps.
9 * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
13 static char sccsid[] = "@(#) diag.c 1.1 94/12/28 17:42:20";
16 /* System libraries */
27 struct tcpd_context tcpd_context;
30 /* tcpd_diag - centralize error reporter */
32 static void tcpd_diag(int severity, char *tag, char *format, va_list ap)
36 if (tcpd_context.file)
37 sprintf(fmt, "%s: %s, line %d: %s",
38 tag, tcpd_context.file, tcpd_context.line, format);
40 sprintf(fmt, "%s: %s", tag, format);
41 vsyslog(severity, fmt, ap);
44 /* tcpd_warn - report problem of some sort and proceed */
46 void VARARGS(tcpd_warn, char *, format)
50 VASTART(ap, char *, format);
51 tcpd_diag(LOG_WARNING, "warning", format, ap);
55 /* tcpd_jump - report serious problem and jump */
57 void VARARGS(tcpd_jump, char *, format)
61 VASTART(ap, char *, format);
62 tcpd_diag(LOG_ERR, "error", format, ap);
64 longjmp(tcpd_buf, AC_ERROR);