From 2fe6d5d5a1025007a3e67d6040c1962734cbb6ea Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 19 Dec 2001 19:18:37 +0000 Subject: Added AC_CHECK_FUNCS(syslog vsyslog). nsswitch code uses vsyslog without checking for it. Provide replacement for vsyslog in lib/snprintf if not found by configure. Jeremy. (This used to be commit ab2e55cdb376d6699c9a09fac243fba7d3840447) --- source3/lib/snprintf.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source3/lib') diff --git a/source3/lib/snprintf.c b/source3/lib/snprintf.c index 7d6da95f8e..900ba381a0 100644 --- a/source3/lib/snprintf.c +++ b/source3/lib/snprintf.c @@ -811,6 +811,20 @@ static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c) } #endif +#ifndef HAVE_VSYSLOG +#ifdef HAVE_SYSLOG + void vsyslog (int facility_priority, char *format, va_list arglist) +{ + char *msg = NULL; + vasprintf(&msg, format, argslist); + if (!msg) + return; + syslog(facility_priority, "%s", msg); + free(msg); +} +#endif /* HAVE_SYSLOG */ +#endif /* HAVE_VSYSLOG */ + #ifdef TEST_SNPRINTF int sprintf(char *str,const char *fmt,...); -- cgit