aboutsummaryrefslogtreecommitdiff
path: root/games/openbor4432
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/openbor4432
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/openbor4432')
-rw-r--r--games/openbor4432/files/patch-source_ramlib_ram.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/games/openbor4432/files/patch-source_ramlib_ram.c b/games/openbor4432/files/patch-source_ramlib_ram.c
index 5a32a492ed5c..c88e7fda3724 100644
--- a/games/openbor4432/files/patch-source_ramlib_ram.c
+++ b/games/openbor4432/files/patch-source_ramlib_ram.c
@@ -48,7 +48,7 @@ Implement Linux-like memory stats for BSDs
#if (__GNUC__ > 3)
extern unsigned long _end;
extern unsigned long _start;
-@@ -93,6 +114,49 @@ u64 getFreeRam(int byte_size)
+@@ -93,6 +114,48 @@ u64 getFreeRam(int byte_size)
return 0;
}
return (u64)(((vms.inactive_count + vms.free_count) * size) / byte_size);
@@ -62,9 +62,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",