diff options
author | 2015-09-12 14:30:31 +0000 | |
---|---|---|
committer | 2015-09-12 14:30:31 +0000 | |
commit | 4fb98022c586790e6541c32e29eed3635af29b87 (patch) | |
tree | 2f426c36178d23712db5543510e053e5f4866388 /lib/libc/gen/syslog.c | |
parent | Uncopy and unpaste dtls1_send_server_key_exchange(). Removes another 329 (diff) | |
download | wireguard-openbsd-4fb98022c586790e6541c32e29eed3635af29b87.tar.xz wireguard-openbsd-4fb98022c586790e6541c32e29eed3635af29b87.zip |
Wrap <syslog.h> so that internal calls go direct and they're all weak symbols
Delete code that's a no-op now that we don't use sockets
Eliminate unnecessary #includes
Diffstat (limited to 'lib/libc/gen/syslog.c')
-rw-r--r-- | lib/libc/gen/syslog.c | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/lib/libc/gen/syslog.c b/lib/libc/gen/syslog.c index e713b64edcf..ccbf5c03151 100644 --- a/lib/libc/gen/syslog.c +++ b/lib/libc/gen/syslog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syslog.c,v 1.31 2011/05/30 18:48:33 martynas Exp $ */ +/* $OpenBSD: syslog.c,v 1.32 2015/09/12 14:30:31 guenther Exp $ */ /* * Copyright (c) 1983, 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -29,26 +29,12 @@ */ #include <sys/types.h> -#include <sys/socket.h> -#include <sys/syslog.h> -#include <sys/uio.h> -#include <sys/un.h> -#include <netdb.h> - -#include <errno.h> -#include <fcntl.h> -#include <paths.h> -#include <stdio.h> -#include <string.h> -#include <time.h> -#include <unistd.h> #include <stdarg.h> +#include <syslog.h> +#include <time.h> static struct syslog_data sdata = SYSLOG_DATA_INIT; -void __vsyslog_r(int pri, struct syslog_data *, size_t (*)(char *, size_t), - const char *, va_list); - static size_t gettime(char *buf, size_t maxsize) { @@ -63,7 +49,6 @@ gettime(char *buf, size_t maxsize) * syslog, vsyslog -- * print message on log file; output is intended for syslogd(8). */ -/* PRINTFLIKE2 */ void syslog(int pri, const char *fmt, ...) { @@ -73,12 +58,14 @@ syslog(int pri, const char *fmt, ...) vsyslog(pri, fmt, ap); va_end(ap); } +DEF_WEAK(syslog); void vsyslog(int pri, const char *fmt, va_list ap) { __vsyslog_r(pri, &sdata, &gettime, fmt, ap); } +DEF_WEAK(vsyslog); void openlog(const char *ident, int logstat, int logfac) @@ -96,7 +83,7 @@ closelog(void) int setlogmask(int pmask) { - return setlogmask_r(pmask, &sdata); + return (setlogmask_r(pmask, &sdata)); } /* setlogmask -- set the log mask level */ @@ -110,3 +97,4 @@ setlogmask_r(int pmask, struct syslog_data *data) data->log_mask = pmask; return (omask); } +DEF_WEAK(setlogmask_r); |