[Xfce4-commits] [panel-plugins/xfce4-systemload-plugin] 04/07: merge patch using HW_PHYSMEM64 inconditionally on OpenBSD

noreply at xfce.org noreply at xfce.org
Fri Nov 21 10:11:34 CET 2014


This is an automated email from the git hooks/post-receive script.

landry pushed a commit to branch master
in repository panel-plugins/xfce4-systemload-plugin.

commit ee3250b9bf5f46d9ca41f49be1aaa5491577e462
Author: Landry Breuil <landry at xfce.org>
Date:   Fri Nov 21 09:10:28 2014 +0100

    merge patch using HW_PHYSMEM64 inconditionally on OpenBSD
---
 panel-plugin/memswap.c |   19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/panel-plugin/memswap.c b/panel-plugin/memswap.c
index 8e8a264..c19cb69 100644
--- a/panel-plugin/memswap.c
+++ b/panel-plugin/memswap.c
@@ -289,20 +289,11 @@ gint read_memswap(gulong *mem, gulong *swap, gulong *MT, gulong *MU, gulong *ST,
 
 #define ARRLEN(X) (sizeof(X)/sizeof(X[0]))
     {
-        static int mib[2];
-        /* 64-bit datatype */
-        if(sizeof(size_t) == 8) {
-            mib[0] = CTL_HW;
-            mib[1] = HW_PHYSMEM64;
-        }
-        /* assume 32-bit datatype */
-        else {
-            mib[0] = CTL_HW;
-            mib[1] = HW_PHYSMEM;
-        }
-        len = sizeof(MTotal);
-        sysctl(mib, ARRLEN(mib), &MTotal, &len, NULL, 0);
-        MTotal >>= 10;
+        static int mib[] = { CTL_HW, HW_PHYSMEM64 };
+        int64_t x;
+        len = sizeof(x);
+        sysctl(mib, ARRLEN(mib), &x, &len, NULL, 0);
+        MTotal = x >> 10;
     }
 
     {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list