[PATCH] physical memory size computing error

There are two minor bugs on physical memory size computing:
(1) fromunits() returns wrong value for "2001844kB", which consists of
more than one digits.
(2) memory()['memtotal'] is in kB. If "--realmem" is not provided at
CLI, totalmem() returns number in MB and the "firmware/hardware"
amount will be minus. totalmem() needs to always return value in kB.

Here is how to test this patch:
(1) Do "smem -w" , the "firmware/hardware" amount should not be minus.
(2) Do "smem -w -R 2001844kB" (change 2001844kB per your PC, note to
keep it in kB unit) , the "firmware/hardware" amount should not be
minus.

Here's a patch to fix these issues.
This commit is contained in:
??? 2009-05-14 22:08:38 -05:00
commit 4865bf2967

2
smem
View file

@ -77,7 +77,7 @@ def totalmem():
_totalmem = fromunits(options.realmem)
else:
_totalmem = memory()['memtotal']
return _totalmem / 1024
return _totalmem
_kernelsize = 0
def kernelsize():