X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcurl_json.c;h=5d96cbd51220c848815e049a2acf0da8106a3860;hb=a369de205538191d4c23af2277f6ba0b2039f076;hp=a2f287a81668b824986b55f4c122c510034b15e5;hpb=d544398864bc02dfd1623e6d005591b512e2f6c6;p=collectd.git diff --git a/src/curl_json.c b/src/curl_json.c index a2f287a8..5d96cbd5 100644 --- a/src/curl_json.c +++ b/src/curl_json.c @@ -74,7 +74,7 @@ typedef struct { * exists for this part of the JSON structure. */ typedef struct { cj_tree_entry_t *entry; - _Bool in_array; + bool in_array; int index; char name[DATA_MAX_NAME_LEN]; } cj_state_t; @@ -91,9 +91,9 @@ struct cj_s /* {{{ */ char *user; char *pass; char *credentials; - _Bool digest; - _Bool verify_peer; - _Bool verify_host; + bool digest; + bool verify_peer; + bool verify_host; char *cacert; struct curl_slist *headers; char *post_body; @@ -256,7 +256,6 @@ static int cj_cb_number(void *ctx, const char *number, yajl_len_t number_len) { value_t vt; int status = parse_value(buffer, &vt, type); if (status != 0) { - NOTICE("curl_json plugin: Unable to parse number: \"%s\"", buffer); cj_advance_array(ctx); return CJ_CB_CONTINUE; } @@ -325,7 +324,7 @@ static int cj_cb_start_array(void *ctx) { return CJ_CB_ABORT; } db->depth++; - db->state[db->depth].in_array = 1; + db->state[db->depth].in_array = true; db->state[db->depth].index = 0; cj_load_key(db, "0"); @@ -335,7 +334,7 @@ static int cj_cb_start_array(void *ctx) { static int cj_cb_end_array(void *ctx) { cj_t *db = (cj_t *)ctx; - db->state[db->depth].in_array = 0; + db->state[db->depth].in_array = false; return cj_cb_end(ctx); } @@ -824,7 +823,6 @@ static void cj_submit_impl(cj_t *db, cj_key_t *key, value_t *value) /* {{{ */ static int cj_sock_perform(cj_t *db) /* {{{ */ { - char errbuf[1024]; struct sockaddr_un sa_unix = { .sun_family = AF_UNIX, }; @@ -835,8 +833,7 @@ static int cj_sock_perform(cj_t *db) /* {{{ */ return -1; if (connect(fd, (struct sockaddr *)&sa_unix, sizeof(sa_unix)) < 0) { ERROR("curl_json plugin: connect(%s) failed: %s", - (db->sock != NULL) ? db->sock : "", - sstrerror(errno, errbuf, sizeof(errbuf))); + (db->sock != NULL) ? db->sock : "", STRERRNO); close(fd); return -1; } @@ -847,8 +844,7 @@ static int cj_sock_perform(cj_t *db) /* {{{ */ red = read(fd, buffer, sizeof(buffer)); if (red < 0) { ERROR("curl_json plugin: read(%s) failed: %s", - (db->sock != NULL) ? db->sock : "", - sstrerror(errno, errbuf, sizeof(errbuf))); + (db->sock != NULL) ? db->sock : "", STRERRNO); close(fd); return -1; }