From fa6abf3a80eeafe9b70ffd3c5d0541963b21b9c4 Mon Sep 17 00:00:00 2001 From: Benny Siegert Date: Sat, 26 Mar 2016 21:40:07 +0100 Subject: NetBSD does not have send or receive quotas. --- src/in_sysctl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/in_sysctl.c b/src/in_sysctl.c index ff71b4d..595e4f4 100644 --- a/src/in_sysctl.c +++ b/src/in_sysctl.c @@ -232,11 +232,13 @@ sysctl_read(void) snprintf(info_buf, sizeof(info_buf), "%u", ifm->ifm_data.ifi_metric); element_update_info(e, "Metric", info_buf); +#ifndef __NetBSD__ snprintf(info_buf, sizeof(info_buf), "%u", ifm->ifm_data.ifi_recvquota); element_update_info(e, "RX-Quota", info_buf); snprintf(info_buf, sizeof(info_buf), "%u", ifm->ifm_data.ifi_xmitquota); element_update_info(e, "TX-Quota", info_buf); +#endif element_notify_update(e, NULL); element_lifesign(e, 1); -- cgit v1.2.3 From 74770b880692a97b74e971825a7f2f445b0f2aa5 Mon Sep 17 00:00:00 2001 From: Benny Siegert Date: Sat, 26 Mar 2016 21:42:05 +0100 Subject: Use uintmax_t cast for some printfs. Some of the BSDs have 32-bit, some 64-bit vars for this. --- src/in_sysctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/in_sysctl.c b/src/in_sysctl.c index 595e4f4..faf647a 100644 --- a/src/in_sysctl.c +++ b/src/in_sysctl.c @@ -226,10 +226,10 @@ sysctl_read(void) attr_update(e, m->attrid, rx, tx, flags); } - snprintf(info_buf, sizeof(info_buf), "%u", ifm->ifm_data.ifi_mtu); + snprintf(info_buf, sizeof(info_buf), "%ju", (uintmax_t)ifm->ifm_data.ifi_mtu); element_update_info(e, "MTU", info_buf); - snprintf(info_buf, sizeof(info_buf), "%u", ifm->ifm_data.ifi_metric); + snprintf(info_buf, sizeof(info_buf), "%ju", (uintmax_t)ifm->ifm_data.ifi_metric); element_update_info(e, "Metric", info_buf); #ifndef __NetBSD__ -- cgit v1.2.3