2000-12-31 00:45:44 +03:00
|
|
|
/* $NetBSD: fakelog.c,v 1.4 2000/12/30 21:45:44 martin Exp $ */
|
1997-10-12 01:41:34 +04:00
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
|
1997-10-12 01:41:34 +04:00
|
|
|
#include <sys/cdefs.h>
|
1997-01-11 05:06:52 +03:00
|
|
|
#ifndef lint
|
1997-10-12 01:41:34 +04:00
|
|
|
#if 0
|
1997-01-11 05:06:52 +03:00
|
|
|
static char sccsid[] = "@(#) fakelog.c 1.3 94/12/28 17:42:21";
|
1997-10-12 01:41:34 +04:00
|
|
|
#else
|
2000-12-31 00:45:44 +03:00
|
|
|
__RCSID("$NetBSD: fakelog.c,v 1.4 2000/12/30 21:45:44 martin Exp $");
|
1997-10-12 01:41:34 +04:00
|
|
|
#endif
|
1997-01-11 05:06:52 +03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdio.h>
|
1997-10-12 01:41:34 +04:00
|
|
|
#include <syslog.h>
|
1997-01-11 05:06:52 +03:00
|
|
|
|
|
|
|
#include "mystdarg.h"
|
1997-10-12 01:41:34 +04:00
|
|
|
#include "percent_m.h"
|
1997-01-11 05:06:52 +03:00
|
|
|
|
|
|
|
/* openlog - dummy */
|
|
|
|
|
|
|
|
/* ARGSUSED */
|
|
|
|
|
1997-10-12 01:41:34 +04:00
|
|
|
void
|
1997-01-11 05:06:52 +03:00
|
|
|
openlog(name, logopt, facility)
|
1997-10-12 01:41:34 +04:00
|
|
|
const char *name;
|
1997-01-11 05:06:52 +03:00
|
|
|
int logopt;
|
|
|
|
int facility;
|
|
|
|
{
|
|
|
|
/* void */
|
|
|
|
}
|
|
|
|
|
|
|
|
/* vsyslog - format one record */
|
|
|
|
|
1997-10-12 01:41:34 +04:00
|
|
|
void
|
1997-01-11 05:06:52 +03:00
|
|
|
vsyslog(severity, fmt, ap)
|
|
|
|
int severity;
|
1997-10-12 01:41:34 +04:00
|
|
|
const char *fmt;
|
2000-12-31 00:45:44 +03:00
|
|
|
_BSD_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 */
|
|
|
|
|
1997-10-12 01:41:34 +04:00
|
|
|
void
|
|
|
|
#ifdef __STDC__
|
|
|
|
syslog(int severity, const char *fmt, ...)
|
|
|
|
#else
|
|
|
|
syslog(va_alist)
|
|
|
|
va_dcl
|
|
|
|
#endif
|
1997-01-11 05:06:52 +03:00
|
|
|
{
|
|
|
|
va_list ap;
|
1997-10-12 01:41:34 +04:00
|
|
|
#ifndef __STDC__
|
|
|
|
int severity;
|
1997-01-11 05:06:52 +03:00
|
|
|
char *fmt;
|
|
|
|
|
1997-10-12 01:41:34 +04:00
|
|
|
va_start(ap);
|
|
|
|
severity = va_arg(ap, int);
|
|
|
|
fmt = va_arg(ap, char *);
|
|
|
|
#else
|
|
|
|
va_start(ap, fmt);
|
|
|
|
#endif
|
1997-01-11 05:06:52 +03:00
|
|
|
vsyslog(severity, fmt, ap);
|
1997-10-12 01:41:34 +04:00
|
|
|
va_end(ap);
|
1997-01-11 05:06:52 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* closelog - dummy */
|
|
|
|
|
1997-10-12 01:41:34 +04:00
|
|
|
void
|
1997-01-11 05:06:52 +03:00
|
|
|
closelog()
|
|
|
|
{
|
|
|
|
/* void */
|
|
|
|
}
|