system: fix typo causing bug.

This commit is contained in:
Alastair Poole 2019-06-08 23:53:10 +01:00
parent cced6b35fa
commit 994f1ea1b3
2 changed files with 4 additions and 3 deletions

View File

@ -458,13 +458,14 @@ _memory_usage_get(meminfo_t *memory)
fields++; fields++;
} }
if (fields >= 8) if (fields >= 8)
break; break;
} }
memory->cached += tmp_slab; memory->cached += tmp_slab;
memory->used = memory->total - tmp_free - memory->cached - memory->buffered; memory->used = memory->total - tmp_free - memory->cached - memory->buffered;
memory->swap_used = memory->swap_total = swap_free; memory->swap_used = memory->swap_total - swap_free;
fclose(f); fclose(f);
#elif defined(__FreeBSD__) || defined(__DragonFly__) #elif defined(__FreeBSD__) || defined(__DragonFly__)

View File

@ -347,10 +347,10 @@ _memory_view_update(Ui *ui, results_t *results)
elm_progressbar_unit_format_set(progress, elm_progressbar_unit_format_set(progress,
eina_slstr_printf( eina_slstr_printf(
"%lu %c / %lu %c", "%lu %c / %lu %c",
_mem_adjust(ui->data_unit, results->memory.swap_total - results->memory.swap_used), ui->data_unit, _mem_adjust(ui->data_unit, results->memory.swap_used), ui->data_unit,
_mem_adjust(ui->data_unit, results->memory.swap_total), ui->data_unit)); _mem_adjust(ui->data_unit, results->memory.swap_total), ui->data_unit));
ratio = results->memory.swap_total / 100.0; ratio = results->memory.swap_total / 100.0;
value = (results->memory.swap_total - results->memory.swap_used) / ratio; value = results->memory.swap_used / ratio;
_progressbar_value_force_set(progress, value / 100); _progressbar_value_force_set(progress, value / 100);
} }