diff options
Diffstat (limited to '')
-rw-r--r-- | lib/zlog.c | 20 |
1 files changed, 14 insertions, 6 deletions
@@ -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 */ |