continue;
}
- status = camqp_read_header (conf);
+ camqp_read_header (conf);
amqp_maybe_release_buffers (conf->connection);
} /* while (subscriber_threads_running) */
ssnprintf (filename, sizeof (filename), "%s/%s/info", dir, power_supply);
fh = fopen (filename, "r");
- if ((fh = fopen (filename, "r")) == NULL)
+ if (fh == NULL)
return (errno);
/* last full capacity: 40090 mWh */
ssnprintf (filename, sizeof (filename), "%s/%s/state", dir, power_supply);
fh = fopen (filename, "r");
- if ((fh = fopen (filename, "r")) == NULL)
+ if (fh == NULL)
{
if ((errno == EAGAIN) || (errno == EINTR) || (errno == ENOENT))
return (0);
db->tree = cj_avl_create();
tree = db->tree;
- name = key->path;
ptr = key->path;
if (*ptr == '/')
++ptr;
for (i = 0; i < ci->children_num; i++)
{
oconfig_item_t *option = ci->children + i;
- status = 0;
if (strcasecmp ("Match", option->key) == 0)
status = fc_config_add_match (&rule->matches, option);
for (i = 0; i < ci->children_num; i++)
{
oconfig_item_t *option = ci->children + i;
- status = 0;
if (strcasecmp ("Rule", option->key) == 0)
status = fc_config_add_rule (chain, option);
c_avl_node_t *y;
c_avl_node_t *b;
+ assert (x != NULL);
+ assert (x->left != NULL);
+
p = x->parent;
y = x->left;
b = y->right;
y->height = calc_height (y);
return (y);
-} /* void rotate_left */
+} /* void rotate_right */
/*
* (x) (y)
c_avl_node_t *y;
c_avl_node_t *b;
+ assert (x != NULL);
+ assert (x->right != NULL);
+
p = x->parent;
y = x->right;
b = y->left;
collector_t *this = (collector_t *)arg;
while (1) {
- int loop = 1;
-
conn_t *connection;
pthread_mutex_lock (&conns_mutex);
log_debug ("collect: handling connection on fd #%i",
fileno (this->socket));
- while (loop) {
+ while (42) {
/* 256 bytes ought to be enough for anybody ;-) */
char line[256 + 1]; /* line + '\0' */
int len = 0;
errno = 0;
if (NULL == fgets (line, sizeof (line), this->socket)) {
- loop = 0;
-
if (0 != errno) {
char errbuf[1024];
log_err ("collect: reading from socket (fd #%i) "
else {
log_err ("collect: unknown type '%c'", line[0]);
}
- } /* while (loop) */
+ } /* while (42) */
log_debug ("Shutting down connection on fd #%i",
fileno (this->socket));
exit (-1);
}
- status = execvp (pl->exec, pl->argv);
+ execvp (pl->exec, pl->argv);
ERROR ("exec plugin: Failed to execute ``%s'': %s",
pl->exec, sstrerror (errno, errbuf, sizeof (errbuf)));
if ((map->ds_type == DS_TYPE_COUNTER)
|| (map->ds_type == DS_TYPE_ABSOLUTE))
val_copy = value_counter;
- if (map->ds_type == DS_TYPE_GAUGE)
+ else if (map->ds_type == DS_TYPE_GAUGE)
val_copy = value_gauge;
else if (map->ds_type == DS_TYPE_DERIVE)
val_copy = value_derive;
if (fd < 0)
{
status = errno;
- fd = -1;
continue;
}
{
status = errno;
close (fd);
- fd = -1;
continue;
}
{
status = errno;
close (fd);
- fd = -1;
continue;
}
else
values_num = 1;
- status = 0;
if (host->connection == NULL)
{
status = EBADF;
for (i = 0; i < ci->children_num; i++)
{
oconfig_item_t *child = ci->children + i;
- status = 0;
if (strcasecmp ("Type", child->key) == 0)
status = cf_util_get_string_buffer (child,
for (i = 0; i < ci->children_num; i++)
{
oconfig_item_t *child = ci->children + i;
- status = 0;
if (strcasecmp ("Instance", child->key) == 0)
status = cf_util_get_string_buffer (child,
receive_list_tail = private_list_tail;
receive_list_length += private_list_length;
- private_list_head = NULL;
- private_list_tail = NULL;
- private_list_length = 0;
-
pthread_cond_signal (&receive_list_cond);
pthread_mutex_unlock (&receive_list_lock);
}
case 42:
case 44:
proc40_names_num = 36;
+ break;
case 46:
case 47:
case 51:
(items_num + pkt_item_num) * res_item_size);
if (items == NULL)
{
- items = *res_data;
ERROR ("ntpd plugin: realloc failed.");
continue;
}
if (endptr == NULL)
{
ERROR ("onewire plugin: Buffer is not a number: %s", buffer);
- status = -1;
continue;
}
if (endptr == NULL)
{
ERROR ("onewire plugin: Buffer is not a number: %s", buffer);
- status = -1;
continue;
}
post_compress = 0;
pre_decompress = 0;
post_decompress = 0;
- overhead_rx = 0;
- overhead_tx = 0;
while (fgets (buffer, sizeof (buffer), fh) != NULL)
{
* `ts_wait'. */
time_calc (&ts_wait, &ts_int, &tv_begin, &tv_end);
- status = pthread_cond_timedwait (&ping_cond, &ping_lock, &ts_wait);
+ pthread_cond_timedwait (&ping_cond, &ping_lock, &ts_wait);
if (ping_thread_loop <= 0)
break;
} /* while (ping_thread_loop > 0) */
timeout.tv_sec=5;
timeout.tv_usec=0;
status = setsockopt (sd, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof (timeout));
+ if (status != 0)
+ {
+ FUNC_ERROR ("setsockopt");
+ close (sd);
+ return (-1);
+ }
status = connect (sd, (struct sockaddr *) &item->sockaddr,
sizeof (item->sockaddr));
buffer[buffer_size] = 0;
} /* while (42) */
close (sd);
- sd = -1;
if (status < 0)
{
for (i = 0; i < ci->children_num; i++)
{
oconfig_item_t *option = ci->children + i;
- status = 0;
if (strcasecmp ("Type", option->key) == 0)
status = cf_util_get_string(option, &dd->type);
for (vb = res->variables, i = 0; (vb != NULL); vb = vb->next_variable, i++)
{
/* Calculate value index from todo list */
- while (!oid_list_todo[i] && (i < oid_list_len))
+ while ((i < oid_list_len) && !oid_list_todo[i])
i++;
/* An instance is configured and the res variable we process is the
cdtime_t interval = 0;
char *plugin_instance = NULL;
int num_matches = 0;
- int status;
int i;
if ((ci->values_num != 1) || (ci->values[0].type != OCONFIG_TYPE_STRING))
return (-1);
}
- status = 0;
for (i = 0; i < ci->children_num; i++)
{
oconfig_item_t *option = ci->children + i;
+ int status;
if (strcasecmp ("Instance", option->key) == 0)
status = cf_util_get_string (option, &plugin_instance);
for (i = 0; i < ci->children_num; ++i){
oconfig_item_t *option = ci->children + i;
- status = 0;
if (strcasecmp("Type", option->key) == 0)
status = cf_util_get_string(option, &md->type);
/* Loop until we find the end of the package */
end_flag = 0;
- escape_flag = 0;
package_buffer_pos = 0;
while (end_flag == 0)
{
for (i = 0; i < ci->children_num; i++)
{
oconfig_item_t *option = ci->children + i;
- status = 0;
if (strcasecmp ("Instance", option->key) == 0)
status = ut_config_type_instance (&th, option);
for (i = 0; i < ci->children_num; i++)
{
oconfig_item_t *option = ci->children + i;
- status = 0;
if (strcasecmp ("Type", option->key) == 0)
status = ut_config_type (&th, option);
for (i = 0; i < ci->children_num; i++)
{
oconfig_item_t *option = ci->children + i;
- status = 0;
if (strcasecmp ("Type", option->key) == 0)
status = ut_config_type (&th, option);
for (i = 0; i < ci->children_num; i++)
{
oconfig_item_t *option = ci->children + i;
- status = 0;
if (strcasecmp ("Type", option->key) == 0)
status = ut_config_type (&th, option);