projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
run all updated *.h *.c through clang-format again
[collectd.git]
/
src
/
netlink.c
diff --git
a/src/netlink.c
b/src/netlink.c
index
0bd598c
..
806265a
100644
(file)
--- a/
src/netlink.c
+++ b/
src/netlink.c
@@
-27,8
+27,8
@@
#include "collectd.h"
#include "collectd.h"
-#include "common.h"
#include "plugin.h"
#include "plugin.h"
+#include "utils/common/common.h"
#include <asm/types.h>
#include <asm/types.h>
@@
-198,7
+198,8
@@
static void submit_two(const char *dev, const char *type,
const char *type_instance, derive_t rx, derive_t tx) {
value_list_t vl = VALUE_LIST_INIT;
value_t values[] = {
const char *type_instance, derive_t rx, derive_t tx) {
value_list_t vl = VALUE_LIST_INIT;
value_t values[] = {
- {.derive = rx}, {.derive = tx},
+ {.derive = rx},
+ {.derive = tx},
};
vl.values = values;
};
vl.values = values;
@@
-509,8
+510,8
@@
static int qos_filter_cb(const struct nlmsghdr *nlh, void *args) {
if (strcmp(tc_type, "filter") == 0)
numberic_id = tm->tcm_parent;
if (strcmp(tc_type, "filter") == 0)
numberic_id = tm->tcm_parent;
- snprintf(tc_inst, sizeof(tc_inst), "%s-%x:%x", kind, numberic_id >> 16,
- numberic_id & 0x0000FFFF);
+ s
s
nprintf(tc_inst, sizeof(tc_inst), "%s-%x:%x", kind, numberic_id >> 16,
+
numberic_id & 0x0000FFFF);
}
DEBUG("netlink plugin: qos_filter_cb: got %s for %s (%i).", tc_type, dev,
}
DEBUG("netlink plugin: qos_filter_cb: got %s for %s (%i).", tc_type, dev,
@@
-541,9
+542,9
@@
static int qos_filter_cb(const struct nlmsghdr *nlh, void *args) {
stats_submitted = true;
stats_submitted = true;
- int r = snprintf(type_instance, sizeof(type_instance), "%s-%s", tc_type,
- tc_inst);
- if (r >= sizeof(type_instance)) {
+ int r = s
s
nprintf(type_instance, sizeof(type_instance), "%s-%s", tc_type,
+
tc_inst);
+ if (
(size_t)
r >= sizeof(type_instance)) {
ERROR("netlink plugin: type_instance truncated to %zu bytes, need %d",
sizeof(type_instance), r);
return MNL_CB_ERROR;
ERROR("netlink plugin: type_instance truncated to %zu bytes, need %d",
sizeof(type_instance), r);
return MNL_CB_ERROR;
@@
-580,9
+581,9
@@
static int qos_filter_cb(const struct nlmsghdr *nlh, void *args) {
if (!stats_submitted && ts != NULL) {
char type_instance[DATA_MAX_NAME_LEN];
if (!stats_submitted && ts != NULL) {
char type_instance[DATA_MAX_NAME_LEN];
- int r = snprintf(type_instance, sizeof(type_instance), "%s-%s", tc_type,
- tc_inst);
- if (r >= sizeof(type_instance)) {
+ int r = s
s
nprintf(type_instance, sizeof(type_instance), "%s-%s", tc_type,
+
tc_inst);
+ if (
(size_t)
r >= sizeof(type_instance)) {
ERROR("netlink plugin: type_instance truncated to %zu bytes, need %d",
sizeof(type_instance), r);
return MNL_CB_ERROR;
ERROR("netlink plugin: type_instance truncated to %zu bytes, need %d",
sizeof(type_instance), r);
return MNL_CB_ERROR;