Fix patch (it was malformed in revision r434478)
This commit is contained in:
parent
e6fd87cd96
commit
7dc890babd
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=434491
@ -1,49 +1,46 @@
|
||||
--- patch-src_task-manager-freebsd.c.orig 2017-02-20 17:11:50 UTC
|
||||
+++ patch-src_task-manager-freebsd.c
|
||||
@@ -0,0 +1,46 @@
|
||||
+--- src/task-manager-freebsd.c.orig 2017-01-23 06:53:01 UTC
|
||||
++++ src/task-manager-freebsd.c
|
||||
+@@ -26,11 +26,11 @@
|
||||
+
|
||||
+ #include "task-manager.h"
|
||||
+
|
||||
+-gulong
|
||||
++guint64
|
||||
+ get_mem_by_bytes (const gchar *name)
|
||||
+ {
|
||||
+- gulong buf;
|
||||
+- gsize len = sizeof (gulong);
|
||||
++ guint64 buf = 0;
|
||||
++ gsize len = sizeof (buf);
|
||||
+
|
||||
+ if (sysctlbyname (name, &buf, &len, NULL, 0) < 0)
|
||||
+ return 0;
|
||||
+@@ -41,13 +41,13 @@ get_mem_by_bytes (const gchar *name)
|
||||
+ guint64
|
||||
+ get_mem_by_pages (const gchar *name)
|
||||
+ {
|
||||
+- gulong res;
|
||||
++ guint64 res;
|
||||
+
|
||||
+ res = get_mem_by_bytes (name);
|
||||
+ if (res > 0)
|
||||
+ res = res * getpagesize ();
|
||||
+
|
||||
+- return (guint64) res;
|
||||
++ return res;
|
||||
+ }
|
||||
+
|
||||
+ gboolean
|
||||
+@@ -55,10 +55,10 @@ get_memory_usage (guint64 *memory_total,
|
||||
+ {
|
||||
+ /* Get memory usage */
|
||||
+ {
|
||||
+- *memory_total = (guint64) get_mem_by_bytes ("hw.physmem");;
|
||||
++ *memory_total = get_mem_by_bytes ("hw.physmem");;
|
||||
+ *memory_free = get_mem_by_pages ("vm.stats.vm.v_free_count");
|
||||
+ *memory_cache = get_mem_by_pages ("vm.stats.vm.v_inactive_count");
|
||||
+- *memory_buffers = (guint64) get_mem_by_bytes ("vfs.bufspace");
|
||||
++ *memory_buffers = get_mem_by_bytes ("vfs.bufspace");
|
||||
+ }
|
||||
+
|
||||
+ /* Get swap usage */
|
||||
--- src/task-manager-freebsd.c.orig 2017-01-23 06:53:01 UTC
|
||||
+++ src/task-manager-freebsd.c
|
||||
@@ -26,11 +26,11 @@
|
||||
|
||||
#include "task-manager.h"
|
||||
|
||||
-gulong
|
||||
+guint64
|
||||
get_mem_by_bytes (const gchar *name)
|
||||
{
|
||||
- gulong buf;
|
||||
- gsize len = sizeof (gulong);
|
||||
+ guint64 buf = 0;
|
||||
+ gsize len = sizeof (buf);
|
||||
|
||||
if (sysctlbyname (name, &buf, &len, NULL, 0) < 0)
|
||||
return 0;
|
||||
@@ -41,13 +41,13 @@ get_mem_by_bytes (const gchar *name)
|
||||
guint64
|
||||
get_mem_by_pages (const gchar *name)
|
||||
{
|
||||
- gulong res;
|
||||
+ guint64 res;
|
||||
|
||||
res = get_mem_by_bytes (name);
|
||||
if (res > 0)
|
||||
res = res * getpagesize ();
|
||||
|
||||
- return (guint64) res;
|
||||
+ return res;
|
||||
}
|
||||
|
||||
gboolean
|
||||
@@ -55,10 +55,10 @@ get_memory_usage (guint64 *memory_total,
|
||||
{
|
||||
/* Get memory usage */
|
||||
{
|
||||
- *memory_total = (guint64) get_mem_by_bytes ("hw.physmem");;
|
||||
+ *memory_total = get_mem_by_bytes ("hw.physmem");;
|
||||
*memory_free = get_mem_by_pages ("vm.stats.vm.v_free_count");
|
||||
*memory_cache = get_mem_by_pages ("vm.stats.vm.v_inactive_count");
|
||||
- *memory_buffers = (guint64) get_mem_by_bytes ("vfs.bufspace");
|
||||
+ *memory_buffers = get_mem_by_bytes ("vfs.bufspace");
|
||||
}
|
||||
|
||||
/* Get swap usage */
|
||||
|
Loading…
Reference in New Issue
Block a user