NetBSD/usr.sbin/tcpdchk/fakelog.c

71 lines
1.1 KiB
C
Raw Normal View History

/* $NetBSD: fakelog.c,v 1.6 2011/07/17 20:54:55 joerg Exp $ */
1997-01-11 05:06:52 +03:00
/*
* This module intercepts syslog() library calls and redirects their output
* to the standard output stream. For interactive testing.
*
* Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
*/
#include <sys/cdefs.h>
1997-01-11 05:06:52 +03:00
#ifndef lint
#if 0
1997-01-11 05:06:52 +03:00
static char sccsid[] = "@(#) fakelog.c 1.3 94/12/28 17:42:21";
#else
__RCSID("$NetBSD: fakelog.c,v 1.6 2011/07/17 20:54:55 joerg Exp $");
#endif
1997-01-11 05:06:52 +03:00
#endif
#include <stdio.h>
#include <syslog.h>
1997-01-11 05:06:52 +03:00
#include "mystdarg.h"
#include "percent_m.h"
1997-01-11 05:06:52 +03:00
/* openlog - dummy */
/* ARGSUSED */
void
1997-01-11 05:06:52 +03:00
openlog(name, logopt, facility)
const char *name;
1997-01-11 05:06:52 +03:00
int logopt;
int facility;
{
/* void */
}
/* vsyslog - format one record */
void
vsyslog(int severity, const char *fmt, va_list ap)
1997-01-11 05:06:52 +03:00
{
char buf[BUFSIZ];
vprintf(percent_m(buf, fmt), ap);
printf("\n");
fflush(stdout);
}
/* syslog - format one record */
/* VARARGS */
void
syslog(int severity, const char *fmt, ...)
1997-01-11 05:06:52 +03:00
{
va_list ap;
va_start(ap, fmt);
1997-01-11 05:06:52 +03:00
vsyslog(severity, fmt, ap);
va_end(ap);
1997-01-11 05:06:52 +03:00
}
/* closelog - dummy */
void
1997-01-11 05:06:52 +03:00
closelog()
{
/* void */
}