[hackers] [slstatus] Fix ram_free for Linux || Aaron Marcher

From: <git_AT_suckless.org>
Date: Fri, 18 May 2018 23:39:19 +0200 (CEST)

commit 49d1e5fae2e4957abcf0f1056b3e8df8d695094c
Author: Aaron Marcher <me_AT_drkhsh.at>
AuthorDate: Fri May 18 23:32:00 2018 +0200
Commit: Aaron Marcher <me_AT_drkhsh.at>
CommitDate: Fri May 18 23:32:00 2018 +0200

    Fix ram_free for Linux

diff --git a/components/ram.c b/components/ram.c
index 57081d2..f451601 100644
--- a/components/ram.c
+++ b/components/ram.c
_AT_@ -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;
         }
 
Received on Fri May 18 2018 - 23:39:19 CEST

This archive was generated by hypermail 2.3.0 : Fri May 18 2018 - 23:48:24 CEST