diff options
author | vkalintiris <vasilis@netdata.cloud> | 2021-01-18 20:00:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-18 20:00:03 +0200 |
commit | 72555a4b3e51603c6dfd15418b1a5e649684e805 (patch) | |
tree | 8aa2be1f2b15ab88d422bc573ddac959fd706811 | |
parent | 5e507fe55203b2c0cfc1610998f6721a4d73805c (diff) |
[health][NFC] Mark internal functions as static. (#10518)
-rw-r--r-- | health/health.c | 8 | ||||
-rw-r--r-- | health/health.h | 4 | ||||
-rw-r--r-- | health/health_json.c | 2 | ||||
-rw-r--r-- | health/health_log.c | 8 |
4 files changed, 9 insertions, 13 deletions
diff --git a/health/health.c b/health/health.c index 9f96a6a7a5..b81361e8a2 100644 --- a/health/health.c +++ b/health/health.c @@ -79,7 +79,7 @@ inline char *health_stock_config_dir(void) { * * Function used to initialize the silencer structure. */ -void health_silencers_init(void) { +static void health_silencers_init(void) { FILE *fd = fopen(silencers_filename, "r"); if (fd) { fseek(fd, 0 , SEEK_END); @@ -135,7 +135,7 @@ void health_init(void) { * * @param host the structure of the host that the function will reload the configuration. */ -void health_reload_host(RRDHOST *host) { +static void health_reload_host(RRDHOST *host) { if(unlikely(!host->health_enabled)) return; @@ -549,7 +549,7 @@ static void health_main_cleanup(void *ptr) { static_thread->enabled = NETDATA_MAIN_THREAD_EXITED; } -SILENCE_TYPE check_silenced(RRDCALC *rc, char* host, SILENCERS *silencers) { +static SILENCE_TYPE check_silenced(RRDCALC *rc, char* host, SILENCERS *silencers) { SILENCER *s; debug(D_HEALTH, "Checking if alarm was silenced via the command API. Alarm info name:%s context:%s chart:%s host:%s family:%s", rc->name, (rc->rrdset)?rc->rrdset->context:"", rc->chart, host, (rc->rrdset)?rc->rrdset->family:""); @@ -591,7 +591,7 @@ SILENCE_TYPE check_silenced(RRDCALC *rc, char* host, SILENCERS *silencers) { * * @return It returns 1 case rrdcalc_flags is DISABLED or 0 otherwise */ -int update_disabled_silenced(RRDHOST *host, RRDCALC *rc) { +static int update_disabled_silenced(RRDHOST *host, RRDCALC *rc) { uint32_t rrdcalc_flags_old = rc->rrdcalc_flags; // Clear the flags rc->rrdcalc_flags &= ~(RRDCALC_FLAG_DISABLED | RRDCALC_FLAG_SILENCED); diff --git a/health/health.h b/health/health.h index 0423ab9aa8..5281e16e3c 100644 --- a/health/health.h +++ b/health/health.h @@ -70,10 +70,7 @@ void health_api_v1_chart_variables2json(RRDSET *st, BUFFER *buf); void health_api_v1_chart_custom_variables2json(RRDSET *st, BUFFER *buf); extern int health_alarm_log_open(RRDHOST *host); -extern void health_alarm_log_close(RRDHOST *host); -extern void health_log_rotate(RRDHOST *host); extern void health_alarm_log_save(RRDHOST *host, ALARM_ENTRY *ae); -extern ssize_t health_alarm_log_read(RRDHOST *host, FILE *fp, const char *filename); extern void health_alarm_log_load(RRDHOST *host); extern ALARM_ENTRY* health_create_alarm_entry( @@ -102,7 +99,6 @@ extern void health_alarm_log(RRDHOST *host, ALARM_ENTRY *ae); extern void health_readdir(RRDHOST *host, const char *user_path, const char *stock_path, const char *subpath); extern char *health_user_config_dir(void); extern char *health_stock_config_dir(void); -extern void health_reload_host(RRDHOST *host); extern void health_alarm_log_free(RRDHOST *host); extern void health_alarm_log_free_one_nochecks_nounlink(ALARM_ENTRY *ae); diff --git a/health/health_json.c b/health/health_json.c index e6faaf5828..d068b54270 100644 --- a/health/health_json.c +++ b/health/health_json.c @@ -291,7 +291,7 @@ void health_aggregate_alarms(RRDHOST *host, BUFFER *wb, BUFFER* contexts, RRDCAL rrdhost_unlock(host); } -void health_alarms2json_fill_alarms(RRDHOST *host, BUFFER *wb, int all, void (*fp)(RRDHOST *, BUFFER *, RRDCALC *)) { +static void health_alarms2json_fill_alarms(RRDHOST *host, BUFFER *wb, int all, void (*fp)(RRDHOST *, BUFFER *, RRDCALC *)) { RRDCALC *rc; int i; for(i = 0, rc = host->alarms; rc ; rc = rc->next) { diff --git a/health/health_log.c b/health/health_log.c index 1ac63b594e..0ee13b13c3 100644 --- a/health/health_log.c +++ b/health/health_log.c @@ -22,14 +22,14 @@ inline int health_alarm_log_open(RRDHOST *host) { return -1; } -inline void health_alarm_log_close(RRDHOST *host) { +static inline void health_alarm_log_close(RRDHOST *host) { if(host->health_log_fp) { fclose(host->health_log_fp); host->health_log_fp = NULL; } } -inline void health_log_rotate(RRDHOST *host) { +static inline void health_log_rotate(RRDHOST *host) { static size_t rotate_every = 0; if(unlikely(rotate_every == 0)) { @@ -158,7 +158,7 @@ inline void health_alarm_log_save(RRDHOST *host, ALARM_ENTRY *ae) { #endif } -uint32_t is_valid_alarm_id(RRDHOST *host, const char *chart, const char *name, uint32_t alarm_id) +static uint32_t is_valid_alarm_id(RRDHOST *host, const char *chart, const char *name, uint32_t alarm_id) { uint32_t hash_chart = simple_hash(chart); uint32_t hash_name = simple_hash(name); @@ -174,7 +174,7 @@ uint32_t is_valid_alarm_id(RRDHOST *host, const char *chart, const char *name, u return 1; } -inline ssize_t health_alarm_log_read(RRDHOST *host, FILE *fp, const char *filename) { +static inline ssize_t health_alarm_log_read(RRDHOST *host, FILE *fp, const char *filename) { errno = 0; char *s, *buf = mallocz(65536 + 1); |