summaryrefslogtreecommitdiff
path: root/netload/linux-proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'netload/linux-proc.c')
-rw-r--r--netload/linux-proc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/netload/linux-proc.c b/netload/linux-proc.c
index 4a0dc34b2..e2bab70fb 100644
--- a/netload/linux-proc.c
+++ b/netload/linux-proc.c
@@ -26,7 +26,7 @@
#define REQUIRED_NETLOAD_FLAGS (1 << GLIBTOP_NETLOAD_BYTES_TOTAL)
-#endif /* NETLOAD_LIBGTOP */
+#else /* not NETLOAD_LIBGTOP */
static char *skip_token(const char *p)
{
@@ -78,6 +78,8 @@ Device_Info *ReadProc()
return retval;
}
+#endif
+
/*
* Return the byte count for a single device. Cache the result from reading the /proc file.
* refresh = 1 means reload the /proc file.
@@ -89,7 +91,11 @@ GetTraffic(int refresh, char *device)
glibtop_netload netload;
glibtop_get_netload (&netload, device);
- return netload.bytes_total;
+
+ if (netload.flags & REQUIRED_NETLOAD_FLAGS)
+ return netload.bytes_total;
+ else
+ return netload.packets_total;
#else
static Device_Info *di = NULL;
Device_Info *d;