mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-02 02:11:04 +02:00
dboxinfo: remove impossible case
The kernel does (and has always) report memory in
kib units, so there is no need to check this.
Origin commit data
------------------
Commit: 5d157456ed
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2014-01-05 (Sun, 05 Jan 2014)
This commit is contained in:
@@ -237,12 +237,8 @@ void CDBoxInfoWidget::paint()
|
|||||||
char buf[80], a[80];
|
char buf[80], a[80];
|
||||||
long long unsigned v;
|
long long unsigned v;
|
||||||
while (fgets(buf, sizeof(buf), procmeminfo)) {
|
while (fgets(buf, sizeof(buf), procmeminfo)) {
|
||||||
char unit[10];
|
if (2 == sscanf(buf, "%[^:]: %llu", a, &v)) {
|
||||||
*unit = 0;
|
v <<= 10;
|
||||||
if ((3 == sscanf(buf, "%[^:]: %llu %s", a, &v, unit))
|
|
||||||
|| (2 == sscanf(buf, "%[^:]: %llu", a, &v))) {
|
|
||||||
if (*unit == 'k')
|
|
||||||
v <<= 10;
|
|
||||||
if (!strcasecmp(a, "MemTotal"))
|
if (!strcasecmp(a, "MemTotal"))
|
||||||
memstat[MEMINFO_RAM][MEMINFO_TOTAL] += v;
|
memstat[MEMINFO_RAM][MEMINFO_TOTAL] += v;
|
||||||
else if (!strcasecmp(a, "MemFree"))
|
else if (!strcasecmp(a, "MemFree"))
|
||||||
|
Reference in New Issue
Block a user