diff --git a/src/ceph.c b/src/ceph.c
index 2a85823299f9cdad62608005265d7254f72f0095..04a397434d1b7c228fc5a885a424ebbb9101c230 100644 (file)
--- a/src/ceph.c
+++ b/src/ceph.c
};
/** Valid types for ceph defined in types.db */
};
/** Valid types for ceph defined in types.db */
-const char * ceph_dset_types [CEPH_DSET_TYPES_NUM] =
+static const char * const ceph_dset_types [CEPH_DSET_TYPES_NUM] =
{"ceph_latency", "ceph_bytes", "ceph_rate"};
/******* ceph_daemon *******/
{"ceph_latency", "ceph_bytes", "ceph_rate"};
/******* ceph_daemon *******/
return -ENOMEM;
}
return -ENOMEM;
}
- d->ds_names[d->ds_num] = malloc(sizeof(char) * DATA_MAX_NAME_LEN);
+ d->ds_names[d->ds_num] = malloc(DATA_MAX_NAME_LEN);
if(!d->ds_names[d->ds_num])
{
return -ENOMEM;
if(!d->ds_names[d->ds_num])
{
return -ENOMEM;
}
g_daemons = tmp;
}
g_daemons = tmp;
- nd = malloc(sizeof(*nd));
+ nd = malloc(sizeof (*nd));
if(!nd)
{
return ENOMEM;
if(!nd)
{
return ENOMEM;
static int add_last(struct ceph_daemon *d, const char *ds_n, double cur_sum,
uint64_t cur_count)
{
static int add_last(struct ceph_daemon *d, const char *ds_n, double cur_sum,
uint64_t cur_count)
{
- d->last_poll_data[d->last_idx] = malloc(1 * sizeof(struct last_data));
+ d->last_poll_data[d->last_idx] = malloc(sizeof (*d->last_poll_data[d->last_idx]));
if(!d->last_poll_data[d->last_idx])
{
return -ENOMEM;
if(!d->last_poll_data[d->last_idx])
{
return -ENOMEM;
if(!d->last_poll_data)
{
if(!d->last_poll_data)
{
- d->last_poll_data = malloc(1 * sizeof(struct last_data *));
+ d->last_poll_data = malloc(sizeof (*d->last_poll_data));
if(!d->last_poll_data)
{
return -ENOMEM;
if(!d->last_poll_data)
{
return -ENOMEM;
fd = socket(PF_UNIX, SOCK_STREAM, 0);
if(fd < 0)
{
fd = socket(PF_UNIX, SOCK_STREAM, 0);
if(fd < 0)
{
- int err = -errno;
+ err = -errno;
ERROR("ceph plugin: cconn_connect: socket(PF_UNIX, SOCK_STREAM, 0) "
"failed: error %d", err);
return err;
ERROR("ceph plugin: cconn_connect: socket(PF_UNIX, SOCK_STREAM, 0) "
"failed: error %d", err);
return err;
}
else
{
}
else
{
- int ret = cconn_handle_event(io);
+ ret = cconn_handle_event(io);
if(ret)
{
WARNING("ceph plugin: cconn_handle_event(name=%s,"
if(ret)
{
WARNING("ceph plugin: cconn_handle_event(name=%s,"