From 87c1738284ad9062cf344d038df2f3953030c1dd Mon Sep 17 00:00:00 2001 From: Kartik Naik Date: Wed, 19 Aug 2026 21:56:32 +0530 Subject: provide a vsyslog fallback in syslog_r instead of the header AIX has syslog but not vsyslog; the fallback lived in syslog.h as non-static function definitions, so it multiply-defined vsyslog_r (also defined in syslog_r.c) and pulled vasprintf in without stdio.h. Detect vsyslog and, when absent, format with vasprintf and call syslog directly from the shim. --- include/compat/syslog.h | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'include') diff --git a/include/compat/syslog.h b/include/compat/syslog.h index 3528eb3..c7a2608 100644 --- a/include/compat/syslog.h +++ b/include/compat/syslog.h @@ -36,23 +36,3 @@ void vsyslog_r(int, struct syslog_data *, const char *, va_list); #endif #endif - -#ifdef _AIX -#ifdef HAVE_SYSLOG -#include -void vsyslog(int facility_priority, const char *format, va_list arglist) { - char *msg = NULL; - vasprintf(&msg, format, arglist); - - if (!msg) - return; - - syslog(facility_priority, "%s", msg); - free(msg); -} -#endif /* HAVE_SYSLOG */ - -void vsyslog_r(int pri, struct syslog_data *data, const char *fmt, va_list ap) { - vsyslog(pri, fmt, ap); -} -#endif /* AIX */ -- cgit v1.2.3-55-g6feb