if (dest_size > dest_len) { \
sstrncpy((dest) + dest_len, (src), dest_size - dest_len); \
} \
if (dest_size > dest_len) { \
sstrncpy((dest) + dest_len, (src), dest_size - dest_len); \
} \
* "rate", use the "sum" in the pair and assign that to the derive
* value. */
if (convert_special_metrics && (state->depth > 2) &&
* "rate", use the "sum" in the pair and assign that to the derive
* value. */
if (convert_special_metrics && (state->depth > 2) &&
(strcmp("journal_wr_bytes", state->stack[state->depth - 1]) == 0) &&
(strcmp("avgcount", state->key) == 0)) {
DEBUG("ceph plugin: Skipping avgcount for filestore.JournalWrBytes");
(strcmp("journal_wr_bytes", state->stack[state->depth - 1]) == 0) &&
(strcmp("avgcount", state->key) == 0)) {
DEBUG("ceph plugin: Skipping avgcount for filestore.JournalWrBytes");
size_t str_len = strlen(str);
size_t suffix_len = strlen(suffix);
size_t offset;
if (suffix_len > str_len)
size_t str_len = strlen(str);
size_t suffix_len = strlen(suffix);
size_t offset;
if (suffix_len > str_len)
offset = str_len - suffix_len;
if (strcmp(str + offset, suffix) == 0)
offset = str_len - suffix_len;
if (strcmp(str + offset, suffix) == 0)
}
static void cut_suffix(char *buffer, size_t buffer_size, char const *str,
}
static void cut_suffix(char *buffer, size_t buffer_size, char const *str,
size_t cmd_len = strlen(cmd);
RETRY_ON_EINTR(
ret, write(io->asok, ((char *)&cmd) + io->amt, cmd_len - io->amt));
size_t cmd_len = strlen(cmd);
RETRY_ON_EINTR(
ret, write(io->asok, ((char *)&cmd) + io->amt, cmd_len - io->amt));
- DEBUG("ceph plugin: cconn_handle_event(name=%s,state=%d,amt=%d,ret=%d)",
+ DEBUG("ceph plugin: cconn_handle_event(name=%s,state=%d,amt=%d,ret=%zd)",
io->d->name, io->state, io->amt, ret);
if (ret < 0) {
return ret;
io->d->name, io->state, io->amt, ret);
if (ret < 0) {
return ret;
case CSTATE_READ_VERSION: {
RETRY_ON_EINTR(ret, read(io->asok, ((char *)(&io->d->version)) + io->amt,
sizeof(io->d->version) - io->amt));
case CSTATE_READ_VERSION: {
RETRY_ON_EINTR(ret, read(io->asok, ((char *)(&io->d->version)) + io->amt,
sizeof(io->d->version) - io->amt));
- DEBUG("ceph plugin: cconn_handle_event(name=%s,state=%d,ret=%d)",
+ DEBUG("ceph plugin: cconn_handle_event(name=%s,state=%d,ret=%zd)",
case CSTATE_READ_AMT: {
RETRY_ON_EINTR(ret, read(io->asok, ((char *)(&io->json_len)) + io->amt,
sizeof(io->json_len) - io->amt));
case CSTATE_READ_AMT: {
RETRY_ON_EINTR(ret, read(io->asok, ((char *)(&io->json_len)) + io->amt,
sizeof(io->json_len) - io->amt));
- DEBUG("ceph plugin: cconn_handle_event(name=%s,state=%d,ret=%d)",
+ DEBUG("ceph plugin: cconn_handle_event(name=%s,state=%d,ret=%zd)",
- DEBUG("ceph plugin: cconn_handle_event(name=%s,state=%d,ret=%d)",
+ DEBUG("ceph plugin: cconn_handle_event(name=%s,state=%d,ret=%zd)",
-static int cconn_main_loop(uint32_t request_type) {
- int ret, some_unreachable = 0;
+static ssize_t cconn_main_loop(uint32_t request_type) {
+ int some_unreachable = 0;
+ ssize_t ret;
struct cconn *io = io_array + i;
ret = cconn_prepare(io, fds + nfds);
if (ret < 0) {
struct cconn *io = io_array + i;
ret = cconn_prepare(io, fds + nfds);
if (ret < 0) {
- WARNING("ceph plugin: cconn_prepare(name=%s,i=%zu,st=%d)=%d",
+ WARNING("ceph plugin: cconn_prepare(name=%s,i=%" PRIsz ",st=%d)=%zd",
io->d->name, i, io->state, ret);
cconn_close(io);
io->request_type = ASOK_REQ_NONE;
io->d->name, i, io->state, ret);
cconn_close(io);
io->request_type = ASOK_REQ_NONE;
}
RETRY_ON_EINTR(ret, poll(fds, nfds, diff));
if (ret < 0) {
}
RETRY_ON_EINTR(ret, poll(fds, nfds, diff));
if (ret < 0) {
ret = cconn_handle_event(io);
if (ret) {
WARNING("ceph plugin: cconn_handle_event(name=%s,"
ret = cconn_handle_event(io);
if (ret) {
WARNING("ceph plugin: cconn_handle_event(name=%s,"
io->d->name, i, io->state, ret);
cconn_close(io);
io->request_type = ASOK_REQ_NONE;
io->d->name, i, io->state, ret);
cconn_close(io);
io->request_type = ASOK_REQ_NONE;