projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Treewide: use bool instead of _Bool
[collectd.git]
/
src
/
apcups.c
diff --git
a/src/apcups.c
b/src/apcups.c
index
31573d1
..
2fa2479
100644
(file)
--- a/
src/apcups.c
+++ b/
src/apcups.c
@@
-73,8
+73,8
@@
typedef struct {
static char *conf_node = NULL;
static char *conf_service = NULL;
/* Defaults to false for backwards compatibility. */
static char *conf_node = NULL;
static char *conf_service = NULL;
/* Defaults to false for backwards compatibility. */
-static
_B
ool conf_report_seconds = 0;
-static
_B
ool conf_persistent_conn = 1;
+static
b
ool conf_report_seconds = 0;
+static
b
ool conf_persistent_conn = 1;
static int global_sockfd = -1;
static int global_sockfd = -1;
@@
-236,7
+236,8
@@
static int apc_query_server(char const *node, char const *service,
char recvline[1024];
char *tokptr;
char *toksaveptr;
char recvline[1024];
char *tokptr;
char *toksaveptr;
- int try = 0;
+ int try
+ = 0;
int status;
#if APCMAIN
int status;
#if APCMAIN
@@
-261,7
+262,8
@@
static int apc_query_server(char const *node, char const *service,
/* net_send closes the socket on error. */
assert(global_sockfd < 0);
if (try == 0) {
/* net_send closes the socket on error. */
assert(global_sockfd < 0);
if (try == 0) {
- try++;
+ try
+ ++;
count_retries++;
continue;
}
count_retries++;
continue;
}
@@
-337,9
+339,7
@@
static int apc_query_server(char const *node, char const *service,
net_shutdown(&global_sockfd);
if (n < 0) {
net_shutdown(&global_sockfd);
if (n < 0) {
- char errbuf[1024];
- ERROR("apcups plugin: Reading from socket failed: %s",
- sstrerror(status, errbuf, sizeof(errbuf)));
+ ERROR("apcups plugin: Reading from socket failed: %s", STRERROR(status));
return -1;
}
return -1;
}
@@
-347,7
+347,7
@@
static int apc_query_server(char const *node, char const *service,
}
static int apcups_config(oconfig_item_t *ci) {
}
static int apcups_config(oconfig_item_t *ci) {
-
_B
ool persistent_conn_set = 0;
+
b
ool persistent_conn_set = 0;
for (int i = 0; i < ci->children_num; i++) {
oconfig_item_t *child = ci->children + i;
for (int i = 0; i < ci->children_num; i++) {
oconfig_item_t *child = ci->children + i;