From 1695b8540a1fa3f5bff9151a2e93024b6152f427 Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Thu, 15 Sep 2005 04:33:04 +0000 Subject: [PATCH] diag.c: - move sccs id string into comment, add DragonFly cvs tag - use stdarg.h instead of mystdarg.h - constify various format strings - remove stdio.h inclusion, which is will be done in tcpd.h tcpd.h: - include stdio.h Requested-by: Jeremy C. Reed Obtained-from: NetBSD - in tcpd_{warn, jump}()'s declaration, constify format strings --- contrib/tcp_wrappers/diag.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/contrib/tcp_wrappers/diag.c b/contrib/tcp_wrappers/diag.c index e0bd792c31..f9b5c94ac8 100644 --- a/contrib/tcp_wrappers/diag.c +++ b/contrib/tcp_wrappers/diag.c @@ -7,33 +7,28 @@ * tcpd_jump() reports a problem and jumps. * * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands. + * + * @(#) diag.c 1.1 94/12/28 17:42:20 + * $DragonFly: src/contrib/tcp_wrappers/diag.c,v 1.2 2005/09/15 04:33:04 sephe Exp $ */ -#ifndef lint -static char sccsid[] = "@(#) diag.c 1.1 94/12/28 17:42:20"; -#endif - /* System libraries */ #include -#include #include +#include /* Local stuff */ #include "tcpd.h" -#include "mystdarg.h" struct tcpd_context tcpd_context; jmp_buf tcpd_buf; /* tcpd_diag - centralize error reporter */ -static void tcpd_diag(severity, tag, format, ap) -int severity; -char *tag; -char *format; -va_list ap; +static void +tcpd_diag(int severity, const char *tag, const char *format, va_list ap) { char fmt[BUFSIZ]; @@ -47,23 +42,25 @@ va_list ap; /* tcpd_warn - report problem of some sort and proceed */ -void VARARGS(tcpd_warn, char *, format) +void +tcpd_warn(const char *format, ...) { va_list ap; - VASTART(ap, char *, format); + va_start(ap, format); tcpd_diag(LOG_ERR, "warning", format, ap); - VAEND(ap); + va_end(ap); } /* tcpd_jump - report serious problem and jump */ -void VARARGS(tcpd_jump, char *, format) +void +tcpd_jump(const char *format, ...) { va_list ap; - VASTART(ap, char *, format); + va_start(ap, format); tcpd_diag(LOG_ERR, "error", format, ap); - VAEND(ap); + va_end(ap); longjmp(tcpd_buf, AC_ERROR); } -- 2.41.0