From 2d1839289eca016893b898dc713cbf1a1df92fc1 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Mon, 1 Mar 2021 11:55:15 +1100 Subject: Fix integer sizing issues in the NetworkIO Meter On Linux kernels the size of the values exported for network device bytes and packets has used a 64 bit integer for quite some time (2.6+ IIRC). Make the procfs value extraction use correct types and change internal types used to rate convert these counters (within the NetworkIO Meter) 64 bit integers, where appropriate. --- dragonflybsd/Platform.c | 10 ++-------- dragonflybsd/Platform.h | 6 ++---- 2 files changed, 4 insertions(+), 12 deletions(-) (limited to 'dragonflybsd') diff --git a/dragonflybsd/Platform.c b/dragonflybsd/Platform.c index 08132716..3646e33a 100644 --- a/dragonflybsd/Platform.c +++ b/dragonflybsd/Platform.c @@ -233,15 +233,9 @@ bool Platform_getDiskIO(DiskIOData* data) { return false; } -bool Platform_getNetworkIO(unsigned long int* bytesReceived, - unsigned long int* packetsReceived, - unsigned long int* bytesTransmitted, - unsigned long int* packetsTransmitted) { +bool Platform_getNetworkIO(NetworkIOData* data) { // TODO - *bytesReceived = 0; - *packetsReceived = 0; - *bytesTransmitted = 0; - *packetsTransmitted = 0; + (void)data; return false; } diff --git a/dragonflybsd/Platform.h b/dragonflybsd/Platform.h index 3c5d9cb2..1ae13938 100644 --- a/dragonflybsd/Platform.h +++ b/dragonflybsd/Platform.h @@ -14,6 +14,7 @@ in the source distribution for its full text. #include "Action.h" #include "BatteryMeter.h" #include "DiskIOMeter.h" +#include "NetworkIOMeter.h" #include "ProcessLocksScreen.h" #include "SignalsPanel.h" @@ -52,10 +53,7 @@ FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid); bool Platform_getDiskIO(DiskIOData* data); -bool Platform_getNetworkIO(unsigned long int* bytesReceived, - unsigned long int* packetsReceived, - unsigned long int* bytesTransmitted, - unsigned long int* packetsTransmitted); +bool Platform_getNetworkIO(NetworkIOData* data); void Platform_getBattery(double* percent, ACPresence* isOnAC); -- cgit v1.2.3