X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fnuma.c;h=dfe7a6dc605bf41fda65f56f5f61bb0296a79823;hp=6ef3f0909b095e0b1f3b87bd6fb61e4a46418c73;hb=48622c3d7c8c0d3ab07cda8a1947c33bfe31df73;hpb=217ec252adf547f2dd048489e2498bc31e8f70db diff --git a/src/numa.c b/src/numa.c index 6ef3f090..dfe7a6dc 100644 --- a/src/numa.c +++ b/src/numa.c @@ -26,8 +26,8 @@ #include "collectd.h" -#include "common.h" #include "plugin.h" +#include "utils/common/common.h" #if !KERNEL_LINUX #error "No applicable input method." @@ -47,7 +47,7 @@ static void numa_dispatch_value(int node, /* {{{ */ vl.values_len = 1; sstrncpy(vl.plugin, "numa", sizeof(vl.plugin)); - ssnprintf(vl.plugin_instance, sizeof(vl.plugin_instance), "node%i", node); + snprintf(vl.plugin_instance, sizeof(vl.plugin_instance), "node%i", node); sstrncpy(vl.type, "vmpage_action", sizeof(vl.type)); sstrncpy(vl.type_instance, type_instance, sizeof(vl.type_instance)); @@ -62,13 +62,12 @@ static int numa_read_node(int node) /* {{{ */ int status; int success; - ssnprintf(path, sizeof(path), NUMA_ROOT_DIR "/node%i/numastat", node); + snprintf(path, sizeof(path), NUMA_ROOT_DIR "/node%i/numastat", node); fh = fopen(path, "r"); if (fh == NULL) { - char errbuf[1024]; ERROR("numa plugin: Reading node %i failed: open(%s): %s", node, path, - sstrerror(errno, errbuf, sizeof(errbuf))); + STRERRNO); return -1; } @@ -127,7 +126,7 @@ static int numa_init(void) /* {{{ */ struct stat statbuf = {0}; int status; - ssnprintf(path, sizeof(path), NUMA_ROOT_DIR "/node%i", max_node + 1); + snprintf(path, sizeof(path), NUMA_ROOT_DIR "/node%i", max_node + 1); status = stat(path, &statbuf); if (status == 0) { @@ -137,9 +136,7 @@ static int numa_init(void) /* {{{ */ break; } else /* ((status != 0) && (errno != ENOENT)) */ { - char errbuf[1024]; - ERROR("numa plugin: stat(%s) failed: %s", path, - sstrerror(errno, errbuf, sizeof(errbuf))); + ERROR("numa plugin: stat(%s) failed: %s", path, STRERRNO); return -1; } }