From 75a03c2c26a1eb2e3da97fa5958a45d20d93d684 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Tue, 7 May 2024 20:41:40 +0200 Subject: [PATCH] const: daemon server logging backend struct --- libdaemon/server/daemon-log.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libdaemon/server/daemon-log.c b/libdaemon/server/daemon-log.c index 7198c293c..1827b55fd 100644 --- a/libdaemon/server/daemon-log.c +++ b/libdaemon/server/daemon-log.c @@ -57,7 +57,7 @@ static void _log_stderr(log_state *s, void **state, int type, const char *messag fprintf(stderr, "%s%s\n", prefix, message); } -struct backend backend[] = { +static const struct backend _backend[] = { { DAEMON_LOG_OUTLET_SYSLOG, _log_syslog }, { DAEMON_LOG_OUTLET_STDERR, _log_stderr }, { 0, 0 } @@ -65,17 +65,17 @@ struct backend backend[] = { void daemon_log(log_state *s, int type, const char *message) { int i = 0; - while ( backend[i].id ) { - if ((int)(s->log_config[type] & backend[i].id) == backend[i].id ) - backend[i].log( s, &s->backend_state[i], type, message ); + while ( _backend[i].id ) { + if ((int)(s->log_config[type] & _backend[i].id) == _backend[i].id ) + _backend[i].log( s, &s->backend_state[i], type, message ); ++ i; } } static int _type_interesting(log_state *s, int type) { int i = 0; - while ( backend[i].id ) { - if ((int)(s->log_config[type] & backend[i].id) == backend[i].id ) + while ( _backend[i].id ) { + if ((int)(s->log_config[type] & _backend[i].id) == _backend[i].id ) return 1; ++ i; }