mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +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.
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