summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/syslog_r.c
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2015-09-12 14:30:31 +0000
committerguenther <guenther@openbsd.org>2015-09-12 14:30:31 +0000
commit4fb98022c586790e6541c32e29eed3635af29b87 (patch)
tree2f426c36178d23712db5543510e053e5f4866388 /lib/libc/gen/syslog_r.c
parentUncopy and unpaste dtls1_send_server_key_exchange(). Removes another 329 (diff)
downloadwireguard-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_r.c')
-rw-r--r--lib/libc/gen/syslog_r.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/lib/libc/gen/syslog_r.c b/lib/libc/gen/syslog_r.c
index fa2a2c839f6..8da599aef64 100644
--- a/lib/libc/gen/syslog_r.c
+++ b/lib/libc/gen/syslog_r.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: syslog_r.c,v 1.8 2015/09/09 10:50:59 bluhm Exp $ */
+/* $OpenBSD: syslog_r.c,v 1.9 2015/09/12 14:30:31 guenther Exp $ */
/*
* Copyright (c) 1983, 1988, 1993
* The Regents of the University of California. All rights reserved.
@@ -29,7 +29,6 @@
*/
#include <sys/types.h>
-#include <sys/syslog.h>
#include <sys/uio.h>
#include <netdb.h>
@@ -38,6 +37,7 @@
#include <paths.h>
#include <stdio.h>
#include <string.h>
+#include <syslog.h>
#include <time.h>
#include <unistd.h>
#include <limits.h>
@@ -45,14 +45,8 @@
extern char *__progname; /* Program name, from crt0. */
-int sendsyslog(const char *, size_t);
-
-void __vsyslog_r(int pri, struct syslog_data *, size_t (*)(char *, size_t),
- const char *, va_list);
/* Reentrant version of syslog, i.e. syslog_r() */
-
-/* PRINTFLIKE3 */
void
syslog_r(int pri, struct syslog_data *data, const char *fmt, ...)
{
@@ -62,19 +56,14 @@ syslog_r(int pri, struct syslog_data *data, const char *fmt, ...)
vsyslog_r(pri, data, fmt, ap);
va_end(ap);
}
+DEF_WEAK(syslog_r);
void
vsyslog_r(int pri, struct syslog_data *data, const char *fmt, va_list ap)
{
- const char *ident;
-
__vsyslog_r(pri, data, NULL, fmt, ap);
-
- /* close the socket without losing log_tag */
- ident = data->log_tag;
- closelog_r(data);
- data->log_tag = ident;
}
+DEF_WEAK(vsyslog_r);
/*
* This is used by both syslog_r and syslog. The latter supplies
@@ -247,10 +236,11 @@ openlog_r(const char *ident, int logstat, int logfac, struct syslog_data *data)
if (logfac != 0 && (logfac &~ LOG_FACMASK) == 0)
data->log_fac = logfac;
}
+DEF_WEAK(openlog_r);
void
closelog_r(struct syslog_data *data)
{
data->log_tag = NULL;
}
-
+DEF_WEAK(closelog_r);