From: Maria Matejka Date: Thu, 14 Nov 2024 20:20:49 +0000 (+0100) Subject: Logging: exposing vlog() to log va_lists X-Git-Tag: v2.16~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4dd5b3d90e962d5fd1794f97a8f82077f8f1eb36;p=thirdparty%2Fbird.git Logging: exposing vlog() to log va_lists --- diff --git a/client/util.c b/client/util.c index 1d83e518d..3a78a7c42 100644 --- a/client/util.c +++ b/client/util.c @@ -17,7 +17,7 @@ /* Client versions of logging functions */ static void -vlog(const char *msg, va_list args) +vlog_cli(const char *msg, va_list args) { char buf[1024]; @@ -38,7 +38,7 @@ bug(const char *msg, ...) va_start(args, msg); cleanup(); fputs("Internal error: ", stderr); - vlog(msg, args); + vlog_cli(msg, args); vfprintf(stderr, msg, args); va_end(args); exit(1); @@ -51,7 +51,7 @@ die(const char *msg, ...) va_start(args, msg); cleanup(); - vlog(msg, args); + vlog_cli(msg, args); va_end(args); exit(1); } diff --git a/lib/birdlib.h b/lib/birdlib.h index 8852b609a..4fea3f9f0 100644 --- a/lib/birdlib.h +++ b/lib/birdlib.h @@ -10,6 +10,7 @@ #define _BIRD_BIRDLIB_H_ #include "lib/alloca.h" +#include /* Ugly structure offset handling macros */ @@ -159,6 +160,7 @@ void log_msg(const char *msg, ...); void log_rl(struct tbf *rl, const char *msg, ...); void die(const char *msg, ...) NORET; void bug(const char *msg, ...) NORET; +void vlog(int class, const char *msg, va_list args); #define L_DEBUG "\001" /* Debugging messages */ #define L_TRACE "\002" /* Protocol tracing */ diff --git a/sysdep/unix/log.c b/sysdep/unix/log.c index 613a6aa54..6c7cac540 100644 --- a/sysdep/unix/log.c +++ b/sysdep/unix/log.c @@ -274,7 +274,7 @@ log_commit(int class, buffer *buf) int buffer_vprint(buffer *buf, const char *fmt, va_list args); -static void +void vlog(int class, const char *msg, va_list args) { buffer buf;