aboutsummaryrefslogtreecommitdiff
path: root/games/openbor3979
diff options
context:
space:
mode:
authorJan Beich <jbeich@FreeBSD.org>2017-09-11 11:51:50 +0000
committerJan Beich <jbeich@FreeBSD.org>2017-09-11 11:51:50 +0000
commit16f78fdf58f794d91cc57b5d947da9df3fa4eb6e (patch)
treec610415b0eae6b57f6eedf197a54755c91f32b77 /games/openbor3979
parent9e35ea9bb04e09671cbaa9a4276b421f88046f6b (diff)
downloadports-16f78fdf58f794d91cc57b5d947da9df3fa4eb6e.tar.gz
ports-16f78fdf58f794d91cc57b5d947da9df3fa4eb6e.zip
games/openbor: simplify initialization of sysctl values
Notes
Notes: svn path=/head/; revision=449628
Diffstat (limited to 'games/openbor3979')
-rw-r--r--games/openbor3979/files/patch-source_ramlib_ram.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/games/openbor3979/files/patch-source_ramlib_ram.c b/games/openbor3979/files/patch-source_ramlib_ram.c
index 7fadd8587473..9485b7bd1906 100644
--- a/games/openbor3979/files/patch-source_ramlib_ram.c
+++ b/games/openbor3979/files/patch-source_ramlib_ram.c
@@ -71,7 +71,7 @@ Implement Linux-like memory stats for BSDs
/////////////////////////////////////////////////////////////////////////////
// Functions
-@@ -107,6 +142,49 @@ u64 getFreeRam(int byte_size)
+@@ -107,6 +142,48 @@ u64 getFreeRam(int byte_size)
return 0;
}
return (u64)(((vms.inactive_count + vms.free_count) * size) / byte_size);
@@ -85,9 +85,8 @@ Implement Linux-like memory stats for BSDs
+ return (u64)((vms.v_free_count + vms.v_inactive_count
+ + vms.v_cache_count) * getpagesize()) / byte_size;
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
-+ u_int v_free_count, v_inactive_count, v_cache_count;
++ u_int v_free_count = 0, v_inactive_count = 0, v_cache_count = 0;
+ size_t sz = sizeof(u_int);
-+ v_free_count = v_inactive_count = v_cache_count = 0;
+ sysctlbyname("vm.stats.vm.v_free_count",
+ &v_free_count, &sz, NULL, 0);
+ sysctlbyname("vm.stats.vm.v_inactive_count",