@cryptotaxi247 / netdata-1 / commits / 764491064

Fix compilation warnings (#16158)

Drop warning when parent is not accepting job status updates

Stelios Fragkakis committed Oct 10, 2023 at 16:21 UTC 7644910646a2b2cbbfadbb731baccba33a393441
6 files changed +21 -9
collectors/plugins.d/pluginsd_parser.c
+2 -2
@@ -812,7 +812,7 @@ static bool inflight_functions_conflict_callback(const DICTIONARY_ITEM *item __m
812 return false;
813 }
814
815 -void delete_job_finalize(struct parser *parser, struct configurable_plugin *plug, const char *fnc_sig, int code) {
815 +void delete_job_finalize(struct parser *parser __maybe_unused, struct configurable_plugin *plug, const char *fnc_sig, int code) {
816 if (code != DYNCFG_VFNC_RET_CFG_ACCEPTED)
817 return;
818
@@ -838,7 +838,7 @@ void delete_job_finalize(struct parser *parser, struct configurable_plugin *plug
838 freez(params_local);
839 }
840
841 -void set_job_finalize(struct parser *parser, struct configurable_plugin *plug, const char *fnc_sig, int code) {
841 +void set_job_finalize(struct parser *parser __maybe_unused, struct configurable_plugin *plug __maybe_unused, const char *fnc_sig, int code) {
842 if (code != DYNCFG_VFNC_RET_CFG_ACCEPTED)
843 return;
844
collectors/systemd-journal.plugin/systemd-journal.c
+2 -1
@@ -384,8 +384,9 @@ static inline size_t netdata_systemd_journal_process_row(sd_journal *j, FACETS *
384 if(!parse_journal_field(data, length, &key, &key_length, &value, &value_length))
385 continue;
386
387 +#ifdef NETDATA_INTERNAL_CHECKS
388 usec_t origin_journal_ut = *msg_ut;
388 -
389 +#endif
390 if(unlikely(key_length == sizeof(JD_SOURCE_REALTIME_TIMESTAMP) - 1 &&
391 memcmp(key, JD_SOURCE_REALTIME_TIMESTAMP, sizeof(JD_SOURCE_REALTIME_TIMESTAMP) - 1) == 0)) {
392 usec_t ut = str2ull(value, NULL);
database/sqlite/sqlite_functions.c
+1 -1
@@ -154,7 +154,7 @@ static void recover_database(const char *sqlite_database, const char *new_sqlite
154 netdata_log_info(" to %s", new_sqlite_database);
155
156 // This will remove the -shm and -wal files when we close the database
157 - db_execute(database, "select count(*) from sqlite_master limit 0");
157 + (void) db_execute(database, "select count(*) from sqlite_master limit 0");
158
159 sqlite3_recover *recover = sqlite3_recover_init(database, "main", new_sqlite_database);
160 if (recover) {
libnetdata/dyn_conf/dyn_conf.c
+15 -3
@@ -244,7 +244,9 @@ void unlink_job(const char *plugin_name, const char *module_name, const char *jo
244 return;
245 BUFFER *buffer = buffer_create(DYN_CONF_PATH_MAX, NULL);
246 buffer_sprintf(buffer, DYN_CONF_DIR "/%s/%s/%s" DYN_CONF_CFG_EXT, plugin_name, module_name, job_name);
247 - unlink(buffer_tostring(buffer));
247 + if (unlink(buffer_tostring(buffer)))
248 + netdata_log_error("Cannot remove file %s", buffer_tostring(buffer));
249 +
250 buffer_free(buffer);
251 }
252
@@ -615,6 +617,7 @@ void freez_dyncfg(void *ptr) {
617 freez(ptr);
618 }
619
620 +#ifdef NETDATA_TEST_DYNCFG
621 static void handle_dyncfg_root(DICTIONARY *plugins_dict, struct uni_http_response *resp, int method)
622 {
623 if (method != HTTP_METHOD_GET) {
@@ -679,6 +682,7 @@ static void handle_plugin_root(struct uni_http_response *resp, int method, struc
682 return;
683 }
684 }
685 +#endif
686
687 void handle_module_root(struct uni_http_response *resp, int method, struct configurable_plugin *plugin, const char *module, void *post_payload, size_t post_payload_size)
688 {
@@ -897,7 +901,14 @@ void handle_job_root(struct uni_http_response *resp, int method, struct module *
901 dictionary_acquired_item_release(mod->jobs, job_item);
902 }
903
900 -struct uni_http_response dyn_conf_process_http_request(DICTIONARY *plugins_dict, int method, const char *plugin, const char *module, const char *job_id, void *post_payload, size_t post_payload_size)
904 +struct uni_http_response dyn_conf_process_http_request(
905 + DICTIONARY *plugins_dict __maybe_unused,
906 + int method __maybe_unused,
907 + const char *plugin __maybe_unused,
908 + const char *module __maybe_unused,
909 + const char *job_id __maybe_unused,
910 + void *post_payload __maybe_unused,
911 + size_t post_payload_size __maybe_unused)
912 {
913 struct uni_http_response resp = {
914 .status = HTTP_RESP_INTERNAL_SERVER_ERROR,
@@ -911,7 +922,7 @@ struct uni_http_response dyn_conf_process_http_request(DICTIONARY *plugins_dict,
922 resp.content_length = strlen(resp.content);
923 resp.status = HTTP_RESP_PRECOND_FAIL;
924 return resp;
914 -#endif
925 +#else
926 if (plugin == NULL) {
927 handle_dyncfg_root(plugins_dict, &resp, method);
928 return resp;
@@ -951,6 +962,7 @@ struct uni_http_response dyn_conf_process_http_request(DICTIONARY *plugins_dict,
962 EXIT_PLUGIN:
963 dictionary_acquired_item_release(plugins_dict, plugin_item);
964 return resp;
965 +#endif
966 }
967
968 void plugin_del_cb(const DICTIONARY_ITEM *item, void *value, void *data)
streaming/rrdpush.c
-1
@@ -471,7 +471,6 @@ void rrdset_push_metrics_finished(RRDSET_STREAM_BUFFER *rsb, RRDSET *st) {
471 // TODO enable this macro before release
472 #define bail_if_no_cap(cap) \
473 if(unlikely(!stream_has_capability(host->sender, cap))) { \
474 - netdata_log_error("STREAM %s [send]: cannot send job status update - parent does not support it.", rrdhost_hostname(host)); \
474 return; \
475 }
476
web/api/web_api_v2.c
+1 -1
@@ -825,7 +825,7 @@ static json_object *job_statuses_flat() {
825 return ret;
826 }
827
828 -static int web_client_api_request_v2_job_statuses(RRDHOST *host, struct web_client *w, char *query) {
828 +static int web_client_api_request_v2_job_statuses(RRDHOST *host __maybe_unused, struct web_client *w, char *query) {
829 json_object *json;
830 if (strstr(query, "grouped") != NULL)
831 json = job_statuses_grouped();