mirror of
https://github.com/pikami/slstatus.git
synced 2024-11-27 05:45:42 +00:00
Fix RAM component on FreeBSD
The current implementation uses the wrong type for given sysctl calls leading to overflow and incorrectly reported RAM usage. The fix is to use 'unsigned int' which is what FreeBSD expects.
This commit is contained in:
parent
3c47701aea
commit
77bfb76a97
@ -178,7 +178,7 @@
|
|||||||
|
|
||||||
const char *
|
const char *
|
||||||
ram_total(void) {
|
ram_total(void) {
|
||||||
long npages;
|
unsigned int npages;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
len = sizeof(npages);
|
len = sizeof(npages);
|
||||||
@ -191,8 +191,8 @@
|
|||||||
|
|
||||||
const char *
|
const char *
|
||||||
ram_perc(void) {
|
ram_perc(void) {
|
||||||
long npages;
|
unsigned int npages;
|
||||||
long active;
|
unsigned int active;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
len = sizeof(npages);
|
len = sizeof(npages);
|
||||||
@ -209,7 +209,7 @@
|
|||||||
|
|
||||||
const char *
|
const char *
|
||||||
ram_used(void) {
|
ram_used(void) {
|
||||||
long active;
|
unsigned int active;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
len = sizeof(active);
|
len = sizeof(active);
|
||||||
|
Loading…
Reference in New Issue
Block a user