0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 09:41:54 +00:00

Merge commit '4dd5b3d9' into thread-next

This commit is contained in:
Maria Matejka 2024-12-10 23:57:59 +01:00
commit fa5923289e
3 changed files with 7 additions and 4 deletions

View File

@ -17,7 +17,7 @@
/* Client versions of logging functions */ /* Client versions of logging functions */
static void static void
vlog(const char *msg, va_list args) vlog_cli(const char *msg, va_list args)
{ {
char buf[1024]; char buf[1024];
@ -38,7 +38,7 @@ bug(const char *msg, ...)
va_start(args, msg); va_start(args, msg);
cleanup(); cleanup();
fputs("Internal error: ", stderr); fputs("Internal error: ", stderr);
vlog(msg, args); vlog_cli(msg, args);
vfprintf(stderr, msg, args); vfprintf(stderr, msg, args);
va_end(args); va_end(args);
exit(1); exit(1);
@ -51,7 +51,7 @@ die(const char *msg, ...)
va_start(args, msg); va_start(args, msg);
cleanup(); cleanup();
vlog(msg, args); vlog_cli(msg, args);
va_end(args); va_end(args);
exit(1); exit(1);
} }

View File

@ -16,6 +16,8 @@
#include "lib/alloca.h" #include "lib/alloca.h"
#include "lib/macro.h" #include "lib/macro.h"
#include <stdarg.h>
/* Ugly structure offset handling macros */ /* Ugly structure offset handling macros */
#define SAME_TYPE(a, b) ({ int _ = ((a) != (b)); !_; }) #define SAME_TYPE(a, b) ({ int _ = ((a) != (b)); !_; })
@ -211,6 +213,7 @@ void log_msg(const char *msg, ...);
void log_rl(struct tbf *rl, const char *msg, ...); void log_rl(struct tbf *rl, const char *msg, ...);
void die(const char *msg, ...) NORET; void die(const char *msg, ...) NORET;
void bug(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_DEBUG "\001" /* Debugging messages */
#define L_TRACE "\002" /* Protocol tracing */ #define L_TRACE "\002" /* Protocol tracing */

View File

@ -337,7 +337,7 @@ log_prepare(log_buffer *buf, int class)
buf->pos[LBP_MSG] = buf->buf.pos; buf->pos[LBP_MSG] = buf->buf.pos;
} }
static void void
vlog(int class, const char *msg, va_list args) vlog(int class, const char *msg, va_list args)
{ {
static _Thread_local log_buffer buf; static _Thread_local log_buffer buf;