X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fceph.c;h=8048f5ddcfce7e7eb57460f54b90da4d75e1d8bf;hb=a503c54a95d139f117650a0e6d80e6edfe81e8bf;hp=26cf215553a1d20116b215a0db3d92ef9429f67f;hpb=711f5b6c86f51061c21bedcaa46214a01de0125c;p=collectd.git diff --git a/src/ceph.c b/src/ceph.c index 26cf2155..8048f5dd 100644 --- a/src/ceph.c +++ b/src/ceph.c @@ -28,8 +28,8 @@ #include "collectd.h" -#include "common.h" #include "plugin.h" +#include "utils/common/common.h" #include #include @@ -990,7 +990,7 @@ static int cconn_connect(struct cconn *io) { return err; } address.sun_family = AF_UNIX; - snprintf(address.sun_path, sizeof(address.sun_path), "%s", io->d->asok_path); + ssnprintf(address.sun_path, sizeof(address.sun_path), "%s", io->d->asok_path); RETRY_ON_EINTR(err, connect(fd, (struct sockaddr *)&address, sizeof(struct sockaddr_un))); if (err < 0) { @@ -1153,8 +1153,8 @@ static ssize_t cconn_handle_event(struct cconn *io) { return -EDOM; case CSTATE_WRITE_REQUEST: { char cmd[32]; - snprintf(cmd, sizeof(cmd), "%s%d%s", "{ \"prefix\": \"", io->request_type, - "\" }\n"); + ssnprintf(cmd, sizeof(cmd), "%s%d%s", "{ \"prefix\": \"", io->request_type, + "\" }\n"); size_t cmd_len = strlen(cmd); RETRY_ON_EINTR( ret, write(io->asok, ((char *)&cmd) + io->amt, cmd_len - io->amt));