[mythtv] [PATCH] System Status RAM/Swap Calculation

Kirk Anderson kirk at nosredna.net
Sat Feb 19 14:19:03 UTC 2005


This simply should add the use of "sinfo.mem_unit" into the
calculation of the true size (in bytes) of RAM and Swap space.

Only file effected:  "mythtv/libs/libmyth/util.cpp"

Kirk

-------------- next part --------------
Index: libs/libmyth/util.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmyth/util.cpp,v
retrieving revision 1.45
diff -u -r1.45 util.cpp
--- libs/libmyth/util.cpp	27 Jan 2005 23:43:13 -0000	1.45
+++ libs/libmyth/util.cpp	19 Feb 2005 14:17:48 -0000
@@ -834,10 +834,10 @@
         return false;
     }
     else
-        totalMB = sinfo.totalram/MB,
-        freeMB  = sinfo.freeram/MB,
-        totalVM = sinfo.totalswap/MB,
-        freeVM  = sinfo.freeswap/MB;
+        totalMB = (sinfo.totalram*sinfo.mem_unit)/MB,
+        freeMB  = (sinfo.freeram*sinfo.mem_unit)/MB,
+        totalVM = (sinfo.totalswap*sinfo.mem_unit)/MB,
+        freeVM  = (sinfo.freeswap*sinfo.mem_unit)/MB;
 
 #elif defined(CONFIG_DARWIN)
     mach_port_t             mp;


More information about the mythtv-dev mailing list