diff options
author | markm <markm@FreeBSD.org> | 1999-03-14 17:13:19 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 1999-03-14 17:13:19 +0000 |
commit | 06c148304a969b7ab848c2ae00bc474c2f6b87b6 (patch) | |
tree | 5c4b2dfe1ca36eeb731956db3380eef1053a2d03 /contrib/tcp_wrappers/myvsyslog.c | |
download | FreeBSD-src-06c148304a969b7ab848c2ae00bc474c2f6b87b6.zip FreeBSD-src-06c148304a969b7ab848c2ae00bc474c2f6b87b6.tar.gz |
Clean import of TCP-wrappers by Wietse Venema.
Rest of build to follow.
Diffstat (limited to 'contrib/tcp_wrappers/myvsyslog.c')
-rw-r--r-- | contrib/tcp_wrappers/myvsyslog.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/contrib/tcp_wrappers/myvsyslog.c b/contrib/tcp_wrappers/myvsyslog.c new file mode 100644 index 0000000..20401f1 --- /dev/null +++ b/contrib/tcp_wrappers/myvsyslog.c @@ -0,0 +1,33 @@ + /* + * vsyslog() for sites without. In order to enable this code, build with + * -Dvsyslog=myvsyslog. We use a different name so that no accidents will + * happen when vsyslog() exists. On systems with vsyslog(), syslog() is + * typically implemented in terms of vsyslog(). + * + * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands. + */ + +#ifndef lint +static char sccsid[] = "@(#) myvsyslog.c 1.1 94/12/28 17:42:33"; +#endif + +#ifdef vsyslog + +#include <stdio.h> + +#include "tcpd.h" +#include "mystdarg.h" + +myvsyslog(severity, format, ap) +int severity; +char *format; +va_list ap; +{ + char fbuf[BUFSIZ]; + char obuf[3 * STRING_LENGTH]; + + vsprintf(obuf, percent_m(fbuf, format), ap); + syslog(severity, "%s", obuf); +} + +#endif |