[Xfce4-commits] <xfce4-taskmanager:master> [openbsd] Don't provide memory/swap values in KiB

Mike Massonnet noreply at xfce.org
Fri May 21 13:38:01 CEST 2010


Updating branch refs/heads/master
         to 97d2f77ee66160ec47f99dda187d3a92b143e8f8 (commit)
       from 175b4cb54121f860eaca1770fc1530faa814f230 (commit)

commit 97d2f77ee66160ec47f99dda187d3a92b143e8f8
Author: Mike Massonnet <mmassonnet at xfce.org>
Date:   Fri May 21 13:37:35 2010 +0200

    [openbsd] Don't provide memory/swap values in KiB

 src/task-manager-bsd.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/task-manager-bsd.c b/src/task-manager-bsd.c
index 2246433..30e3301 100644
--- a/src/task-manager-bsd.c
+++ b/src/task-manager-bsd.c
@@ -162,8 +162,8 @@ gboolean get_cpu_usage (gushort *cpu_count, gfloat *cpu_user, gfloat *cpu_system
 	return TRUE;
 }
 
-/* vmtotal values in #pg, mem wanted in kB */
-#define pagetok(nb) ((nb) * (getpagesize() / 1024))
+/* vmtotal values in #pg */
+#define pagetok(nb) ((nb) * (getpagesize()))
 
 gboolean get_memory_usage (guint64 *memory_total, guint64 *memory_free, guint64 *memory_cache, guint64 *memory_buffers, guint64 *swap_total, guint64 *swap_free)
 {
@@ -197,8 +197,8 @@ gboolean get_memory_usage (guint64 *memory_total, guint64 *memory_free, guint64
 	*swap_total = *swap_free = 0;
 	for (i = 0; i < nswap; i++) {
 		if (swdev[i].se_flags & SWF_ENABLE) {
-			*swap_free += ((swdev[i].se_nblks - swdev[i].se_inuse) / (1024 / DEV_BSIZE));
-			*swap_total += (swdev[i].se_nblks / (1024 / DEV_BSIZE));
+			*swap_free += ((swdev[i].se_nblks - swdev[i].se_inuse) / DEV_BSIZE);
+			*swap_total += (swdev[i].se_nblks / DEV_BSIZE);
 		}
 	}
 	free(swdev);



More information about the Xfce4-commits mailing list