projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove parentheses around return arguments
[collectd.git]
/
src
/
curl.c
diff --git
a/src/curl.c
b/src/curl.c
index
c6f0b60
..
808f242
100644
(file)
--- a/
src/curl.c
+++ b/
src/curl.c
@@
-97,11
+97,11
@@
static size_t cc_curl_callback(void *buf, /* {{{ */
len = size * nmemb;
if (len == 0)
len = size * nmemb;
if (len == 0)
- return
(len)
;
+ return
len
;
wp = user_data;
if (wp == NULL)
wp = user_data;
if (wp == NULL)
- return
(0)
;
+ return
0
;
if ((wp->buffer_fill + len) >= wp->buffer_size) {
char *temp;
if ((wp->buffer_fill + len) >= wp->buffer_size) {
char *temp;
@@
-111,7
+111,7
@@
static size_t cc_curl_callback(void *buf, /* {{{ */
temp = realloc(wp->buffer, temp_size);
if (temp == NULL) {
ERROR("curl plugin: realloc failed.");
temp = realloc(wp->buffer, temp_size);
if (temp == NULL) {
ERROR("curl plugin: realloc failed.");
- return
(0)
;
+ return
0
;
}
wp->buffer = temp;
wp->buffer_size = temp_size;
}
wp->buffer = temp;
wp->buffer_size = temp_size;
@@
-121,7
+121,7
@@
static size_t cc_curl_callback(void *buf, /* {{{ */
wp->buffer_fill += len;
wp->buffer[wp->buffer_fill] = 0;
wp->buffer_fill += len;
wp->buffer[wp->buffer_fill] = 0;
- return
(len)
;
+ return
len
;
} /* }}} size_t cc_curl_callback */
static void cc_web_match_free(web_match_t *wm) /* {{{ */
} /* }}} size_t cc_curl_callback */
static void cc_web_match_free(web_match_t *wm) /* {{{ */
@@
-170,16
+170,16
@@
static int cc_config_append_string(const char *name,
struct curl_slist *temp = NULL;
if ((ci->values_num != 1) || (ci->values[0].type != OCONFIG_TYPE_STRING)) {
WARNING("curl plugin: `%s' needs exactly one string argument.", name);
struct curl_slist *temp = NULL;
if ((ci->values_num != 1) || (ci->values[0].type != OCONFIG_TYPE_STRING)) {
WARNING("curl plugin: `%s' needs exactly one string argument.", name);
- return
(-1)
;
+ return
-1
;
}
temp = curl_slist_append(*dest, ci->values[0].value.string);
if (temp == NULL)
}
temp = curl_slist_append(*dest, ci->values[0].value.string);
if (temp == NULL)
- return
(-1)
;
+ return
-1
;
*dest = temp;
*dest = temp;
- return
(0)
;
+ return
0
;
} /* }}} int cc_config_append_string */
static int cc_config_add_match_dstype(int *dstype_ret, /* {{{ */
} /* }}} int cc_config_append_string */
static int cc_config_add_match_dstype(int *dstype_ret, /* {{{ */
@@
-188,7
+188,7
@@
static int cc_config_add_match_dstype(int *dstype_ret, /* {{{ */
if ((ci->values_num != 1) || (ci->values[0].type != OCONFIG_TYPE_STRING)) {
WARNING("curl plugin: `DSType' needs exactly one string argument.");
if ((ci->values_num != 1) || (ci->values[0].type != OCONFIG_TYPE_STRING)) {
WARNING("curl plugin: `DSType' needs exactly one string argument.");
- return
(-1)
;
+ return
-1
;
}
if (strncasecmp("Gauge", ci->values[0].value.string, strlen("Gauge")) == 0) {
}
if (strncasecmp("Gauge", ci->values[0].value.string, strlen("Gauge")) == 0) {
@@
-243,11
+243,11
@@
static int cc_config_add_match_dstype(int *dstype_ret, /* {{{ */
if (dstype == 0) {
WARNING("curl plugin: `%s' is not a valid argument to `DSType'.",
ci->values[0].value.string);
if (dstype == 0) {
WARNING("curl plugin: `%s' is not a valid argument to `DSType'.",
ci->values[0].value.string);
- return
(-1)
;
+ return
-1
;
}
*dstype_ret = dstype;
}
*dstype_ret = dstype;
- return
(0)
;
+ return
0
;
} /* }}} int cc_config_add_match_dstype */
static int cc_config_add_match(web_page_t *page, /* {{{ */
} /* }}} int cc_config_add_match_dstype */
static int cc_config_add_match(web_page_t *page, /* {{{ */
@@
-262,7
+262,7
@@
static int cc_config_add_match(web_page_t *page, /* {{{ */
match = calloc(1, sizeof(*match));
if (match == NULL) {
ERROR("curl plugin: calloc failed.");
match = calloc(1, sizeof(*match));
if (match == NULL) {
ERROR("curl plugin: calloc failed.");
- return
(-1)
;
+ return
-1
;
}
status = 0;
}
status = 0;
@@
-309,7
+309,7
@@
static int cc_config_add_match(web_page_t *page, /* {{{ */
if (status != 0) {
cc_web_match_free(match);
if (status != 0) {
cc_web_match_free(match);
- return
(status)
;
+ return
status
;
}
match->match =
}
match->match =
@@
-317,7
+317,7
@@
static int cc_config_add_match(web_page_t *page, /* {{{ */
if (match->match == NULL) {
ERROR("curl plugin: match_create_simple failed.");
cc_web_match_free(match);
if (match->match == NULL) {
ERROR("curl plugin: match_create_simple failed.");
cc_web_match_free(match);
- return
(-1)
;
+ return
-1
;
} else {
web_match_t *prev;
} else {
web_match_t *prev;
@@
-331,7
+331,7
@@
static int cc_config_add_match(web_page_t *page, /* {{{ */
prev->next = match;
}
prev->next = match;
}
- return
(0)
;
+ return
0
;
} /* }}} int cc_config_add_match */
static int cc_page_init_curl(web_page_t *wp) /* {{{ */
} /* }}} int cc_config_add_match */
static int cc_page_init_curl(web_page_t *wp) /* {{{ */
@@
-339,7
+339,7
@@
static int cc_page_init_curl(web_page_t *wp) /* {{{ */
wp->curl = curl_easy_init();
if (wp->curl == NULL) {
ERROR("curl plugin: curl_easy_init failed.");
wp->curl = curl_easy_init();
if (wp->curl == NULL) {
ERROR("curl plugin: curl_easy_init failed.");
- return
(-1)
;
+ return
-1
;
}
curl_easy_setopt(wp->curl, CURLOPT_NOSIGNAL, 1L);
}
curl_easy_setopt(wp->curl, CURLOPT_NOSIGNAL, 1L);
@@
-366,7
+366,7
@@
static int cc_page_init_curl(web_page_t *wp) /* {{{ */
wp->credentials = malloc(credentials_size);
if (wp->credentials == NULL) {
ERROR("curl plugin: malloc failed.");
wp->credentials = malloc(credentials_size);
if (wp->credentials == NULL) {
ERROR("curl plugin: malloc failed.");
- return
(-1)
;
+ return
-1
;
}
ssnprintf(wp->credentials, credentials_size, "%s:%s", wp->user,
}
ssnprintf(wp->credentials, credentials_size, "%s:%s", wp->user,
@@
-395,7
+395,7
@@
static int cc_page_init_curl(web_page_t *wp) /* {{{ */
(long)CDTIME_T_TO_MS(plugin_get_interval()));
#endif
(long)CDTIME_T_TO_MS(plugin_get_interval()));
#endif
- return
(0)
;
+ return
0
;
} /* }}} int cc_page_init_curl */
static int cc_config_add_page(oconfig_item_t *ci) /* {{{ */
} /* }}} int cc_page_init_curl */
static int cc_config_add_page(oconfig_item_t *ci) /* {{{ */
@@
-405,13
+405,13
@@
static int cc_config_add_page(oconfig_item_t *ci) /* {{{ */
if ((ci->values_num != 1) || (ci->values[0].type != OCONFIG_TYPE_STRING)) {
WARNING("curl plugin: `Page' blocks need exactly one string argument.");
if ((ci->values_num != 1) || (ci->values[0].type != OCONFIG_TYPE_STRING)) {
WARNING("curl plugin: `Page' blocks need exactly one string argument.");
- return
(-1)
;
+ return
-1
;
}
page = calloc(1, sizeof(*page));
if (page == NULL) {
ERROR("curl plugin: calloc failed.");
}
page = calloc(1, sizeof(*page));
if (page == NULL) {
ERROR("curl plugin: calloc failed.");
- return
(-1)
;
+ return
-1
;
}
page->url = NULL;
page->user = NULL;
}
page->url = NULL;
page->user = NULL;
@@
-428,7
+428,7
@@
static int cc_config_add_page(oconfig_item_t *ci) /* {{{ */
if (page->instance == NULL) {
ERROR("curl plugin: strdup failed.");
sfree(page);
if (page->instance == NULL) {
ERROR("curl plugin: strdup failed.");
sfree(page);
- return
(-1)
;
+ return
-1
;
}
/* Process all children */
}
/* Process all children */
@@
-501,7
+501,7
@@
static int cc_config_add_page(oconfig_item_t *ci) /* {{{ */
if (status != 0) {
cc_web_page_free(page);
if (status != 0) {
cc_web_page_free(page);
- return
(status)
;
+ return
status
;
}
/* Add the new page to the linked list */
}
/* Add the new page to the linked list */
@@
-516,7
+516,7
@@
static int cc_config_add_page(oconfig_item_t *ci) /* {{{ */
prev->next = page;
}
prev->next = page;
}
- return
(0)
;
+ return
0
;
} /* }}} int cc_config_add_page */
static int cc_config(oconfig_item_t *ci) /* {{{ */
} /* }}} int cc_config_add_page */
static int cc_config(oconfig_item_t *ci) /* {{{ */
@@
-545,20
+545,20
@@
static int cc_config(oconfig_item_t *ci) /* {{{ */
if ((success == 0) && (errors > 0)) {
ERROR("curl plugin: All statements failed.");
if ((success == 0) && (errors > 0)) {
ERROR("curl plugin: All statements failed.");
- return
(-1)
;
+ return
-1
;
}
}
- return
(0)
;
+ return
0
;
} /* }}} int cc_config */
static int cc_init(void) /* {{{ */
{
if (pages_g == NULL) {
INFO("curl plugin: No pages have been defined.");
} /* }}} int cc_config */
static int cc_init(void) /* {{{ */
{
if (pages_g == NULL) {
INFO("curl plugin: No pages have been defined.");
- return
(-1)
;
+ return
-1
;
}
curl_global_init(CURL_GLOBAL_SSL);
}
curl_global_init(CURL_GLOBAL_SSL);
- return
(0)
;
+ return
0
;
} /* }}} int cc_init */
static void cc_submit(const web_page_t *wp, const web_match_t *wm, /* {{{ */
} /* }}} int cc_init */
static void cc_submit(const web_page_t *wp, const web_match_t *wm, /* {{{ */
@@
-615,7
+615,7
@@
static int cc_read_page(web_page_t *wp) /* {{{ */
if (status != CURLE_OK) {
ERROR("curl plugin: curl_easy_perform failed with status %i: %s", status,
wp->curl_errbuf);
if (status != CURLE_OK) {
ERROR("curl plugin: curl_easy_perform failed with status %i: %s", status,
wp->curl_errbuf);
- return
(-1)
;
+ return
-1
;
}
if (wp->response_time)
}
if (wp->response_time)
@@
-654,7
+654,7
@@
static int cc_read_page(web_page_t *wp) /* {{{ */
match_value_reset(mv);
} /* for (wm = wp->matches; wm != NULL; wm = wm->next) */
match_value_reset(mv);
} /* for (wm = wp->matches; wm != NULL; wm = wm->next) */
- return
(0)
;
+ return
0
;
} /* }}} int cc_read_page */
static int cc_read(void) /* {{{ */
} /* }}} int cc_read_page */
static int cc_read(void) /* {{{ */
@@
-662,7
+662,7
@@
static int cc_read(void) /* {{{ */
for (web_page_t *wp = pages_g; wp != NULL; wp = wp->next)
cc_read_page(wp);
for (web_page_t *wp = pages_g; wp != NULL; wp = wp->next)
cc_read_page(wp);
- return
(0)
;
+ return
0
;
} /* }}} int cc_read */
static int cc_shutdown(void) /* {{{ */
} /* }}} int cc_read */
static int cc_shutdown(void) /* {{{ */
@@
-670,7
+670,7
@@
static int cc_shutdown(void) /* {{{ */
cc_web_page_free(pages_g);
pages_g = NULL;
cc_web_page_free(pages_g);
pages_g = NULL;
- return
(0)
;
+ return
0
;
} /* }}} int cc_shutdown */
void module_register(void) {
} /* }}} int cc_shutdown */
void module_register(void) {
@@
-679,5
+679,3
@@
void module_register(void) {
plugin_register_read("curl", cc_read);
plugin_register_shutdown("curl", cc_shutdown);
} /* void module_register */
plugin_register_read("curl", cc_read);
plugin_register_shutdown("curl", cc_shutdown);
} /* void module_register */
-
-/* vim: set sw=2 sts=2 et fdm=marker : */