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(severity, tag, format, ap)
40 if (tcpd_context.file)
41 sprintf(fmt, "%s: %s, line %d: %s",
42 tag, tcpd_context.file, tcpd_context.line, format);
44 sprintf(fmt, "%s: %s", tag, format);
45 vsyslog(severity, fmt, ap);
48 /* tcpd_warn - report problem of some sort and proceed */
50 void VARARGS(tcpd_warn, char *, format)
54 VASTART(ap, char *, format);
55 tcpd_diag(LOG_WARNING, "warning", format, ap);
59 /* tcpd_jump - report serious problem and jump */
61 void VARARGS(tcpd_jump, char *, format)
65 VASTART(ap, char *, format);
66 tcpd_diag(LOG_ERR, "error", format, ap);
68 longjmp(tcpd_buf, AC_ERROR);