summaryrefslogtreecommitdiffstats
path: root/lib/zlog.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 04:24:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 04:24:31 +0000
commitacb594b1d825c6e12369cebb941968ec08c840ce (patch)
treed544788908e7353a4f117e2991f15f4236a0c963 /lib/zlog.c
parentAdding upstream version 9.1. (diff)
downloadfrr-acb594b1d825c6e12369cebb941968ec08c840ce.tar.xz
frr-acb594b1d825c6e12369cebb941968ec08c840ce.zip
Adding upstream version 10.0.upstream/10.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/zlog.c')
-rw-r--r--lib/zlog.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/zlog.c b/lib/zlog.c
index 309a955..8734fd5 100644
--- a/lib/zlog.c
+++ b/lib/zlog.c
@@ -4,6 +4,12 @@
*/
#include "zebra.h"
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#ifdef HAVE_GLIBC_BACKTRACE
+#include <execinfo.h>
+#endif /* HAVE_GLIBC_BACKTRACE */
#include <unistd.h>
#include <sys/time.h>
@@ -32,9 +38,6 @@
#ifdef __DragonFly__
#include <sys/lwp.h>
#endif
-#ifdef __APPLE__
-#include <mach/mach_traps.h>
-#endif
#ifdef HAVE_LIBUNWIND
#define UNW_LOCAL_ONLY
@@ -81,7 +84,7 @@ static struct zlog_targets_head zlog_targets;
/* Global setting for buffered vs immediate output. The default is
* per-pthread buffering.
*/
-static bool default_immediate;
+static bool zlog_default_immediate;
/* cf. zlog.h for additional comments on this struct.
*
@@ -442,7 +445,7 @@ static void vzlog_tls(struct zlog_tls *zlog_tls, const struct xref_logmsg *xref,
struct zlog_msg *msg;
char *buf;
bool ignoremsg = true;
- bool immediate = default_immediate;
+ bool immediate = zlog_default_immediate;
/* avoid further processing cost if no target wants this message */
rcu_read_lock();
@@ -963,7 +966,12 @@ struct zlog_target *zlog_target_replace(struct zlog_target *oldzt,
*/
void zlog_set_immediate(bool set_p)
{
- default_immediate = set_p;
+ zlog_default_immediate = set_p;
+}
+
+bool zlog_get_immediate_mode(void)
+{
+ return zlog_default_immediate;
}
/* common init */