diff options
author | Andris Zeila <andris.zeila@zabbix.com> | 2021-10-19 17:45:37 +0300 |
---|---|---|
committer | Andris Zeila <andris.zeila@zabbix.com> | 2021-10-19 17:45:53 +0300 |
commit | 416aaba91a6da87aaf6dd404d157a4c66d4af2d2 (patch) | |
tree | 29f03f0e0c99be78f70f9e2b7107f45f4776f757 /src/libs/zbxaudit | |
parent | e4d575408a18834df0a85b462642229f552af4ef (diff) |
........S. [ZBXNEXT-6923] fixed warnings
Diffstat (limited to 'src/libs/zbxaudit')
-rw-r--r-- | src/libs/zbxaudit/audit.c | 17 | ||||
-rw-r--r-- | src/libs/zbxaudit/audit.h | 1 |
2 files changed, 8 insertions, 10 deletions
diff --git a/src/libs/zbxaudit/audit.c b/src/libs/zbxaudit/audit.c index c6f6286fa4a..8fedf9355ca 100644 --- a/src/libs/zbxaudit/audit.c +++ b/src/libs/zbxaudit/audit.c @@ -292,14 +292,6 @@ void zbx_audit_init(int audit_mode_set) #undef AUDIT_HASHSET_DEF_SIZE } -int zbx_audit_initialized(void) -{ - if (ZBX_AUDITLOG_ENABLED != zbx_get_audit_mode()) - return SUCCEED; - - return 0 == zbx_audit.num_slots ? SUCCEED : FAIL; -} - void zbx_audit_flush(void) { char recsetid_cuid[CUID_LEN]; @@ -353,7 +345,8 @@ int zbx_audit_flush_once(void) while (NULL != (audit_entry = (zbx_audit_entry_t **)zbx_hashset_iter_next(&iter))) { - char id[ZBX_MAX_UINT64_LEN + 1], *pfield, *pvalue, *name_esc, *details_esc; + char id[ZBX_MAX_UINT64_LEN + 1], *pvalue, *name_esc, *details_esc; + const char *pfield; if (AUDIT_ACTION_DELETE != (*audit_entry)->audit_action && 0 == strcmp((*audit_entry)->details_json.buffer, "{}")) @@ -640,6 +633,9 @@ void zbx_audit_entry_append_int(zbx_audit_entry_t *entry, int audit_op, const ch value2 = va_arg(args, int); update_int_json(&entry->details_json, key, value1, value2); break; + default: + THIS_SHOULD_NEVER_HAPPEN; + break; } va_end(args); @@ -662,6 +658,9 @@ void zbx_audit_entry_append_string(zbx_audit_entry_t *entry, int audit_op, const value2 = va_arg(args, const char *); update_str_json(&entry->details_json, key, value1, value2); break; + default: + THIS_SHOULD_NEVER_HAPPEN; + break; } va_end(args); diff --git a/src/libs/zbxaudit/audit.h b/src/libs/zbxaudit/audit.h index 3c742f96cfc..bda6c0e39af 100644 --- a/src/libs/zbxaudit/audit.h +++ b/src/libs/zbxaudit/audit.h @@ -94,7 +94,6 @@ void zbx_audit_init(int audit_mode_set); void zbx_audit_clean(void); void zbx_audit_flush(void); int zbx_audit_flush_once(void); -int zbx_audit_initialized(void); void zbx_audit_update_json_append_string(const zbx_uint64_t id, const int id_table, const char *audit_op, const char *key, const char *value, const char *table, const char *field); void zbx_audit_update_json_append_string_secret(const zbx_uint64_t id, const int id_table, const char *audit_op, |