projects
/
suckless
/
slstatus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
39ee31c
)
Fix ram_free for Linux
author
Aaron Marcher
<me@drkhsh.at>
Fri, 18 May 2018 21:32:00 +0000
(23:32 +0200)
committer
Aaron Marcher
<me@drkhsh.at>
Fri, 18 May 2018 21:32:00 +0000
(23:32 +0200)
components/ram.c
patch
|
blob
|
history
diff --git
a/components/ram.c
b/components/ram.c
index 57081d2a4f86101757a8634a4e3f47b4d757b745..f451601862dd1555d16e9eb6adfa9ae9d31786e2 100644
(file)
--- a/
components/ram.c
+++ b/
components/ram.c
@@
-9,7
+9,11
@@
{
long free;
- return (pscanf("/proc/meminfo", "MemFree: %ld kB\n", &free) == 1) ?
+ return (pscanf("/proc/meminfo",
+ "MemTotal: %ld kB\n"
+ "MemFree: %ld kB\n"
+ "MemAvailable: %ld kB\n",
+ &free, &free, &free) == 3) ?
bprintf("%f", (float)free / 1024 / 1024) : NULL;
}