[BACK]Return to patch-af CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / net / xymonclient / patches

File: [cvs.NetBSD.org] / pkgsrc / net / xymonclient / patches / patch-af (download)

Revision 1.3, Fri Jan 11 00:05:05 2013 UTC (7 years, 7 months ago) by joerg
Branch: MAIN
CVS Tags: pkgsrc-2020Q2-base, pkgsrc-2020Q2, pkgsrc-2020Q1-base, pkgsrc-2020Q1, pkgsrc-2019Q4-base, pkgsrc-2019Q4, pkgsrc-2019Q3-base, pkgsrc-2019Q3, pkgsrc-2019Q2-base, pkgsrc-2019Q2, pkgsrc-2019Q1-base, pkgsrc-2019Q1, pkgsrc-2018Q4-base, pkgsrc-2018Q4, pkgsrc-2018Q3-base, pkgsrc-2018Q3, pkgsrc-2018Q2-base, pkgsrc-2018Q2, pkgsrc-2018Q1-base, pkgsrc-2018Q1, pkgsrc-2017Q4-base, pkgsrc-2017Q4, pkgsrc-2017Q3-base, pkgsrc-2017Q3, pkgsrc-2017Q2-base, pkgsrc-2017Q2, pkgsrc-2017Q1-base, pkgsrc-2017Q1, pkgsrc-2016Q4-base, pkgsrc-2016Q4, pkgsrc-2016Q3-base, pkgsrc-2016Q3, pkgsrc-2016Q2-base, pkgsrc-2016Q2, pkgsrc-2016Q1-base, pkgsrc-2016Q1, pkgsrc-2015Q4-base, pkgsrc-2015Q4, pkgsrc-2015Q3-base, pkgsrc-2015Q3, pkgsrc-2015Q2-base, pkgsrc-2015Q2, pkgsrc-2015Q1-base, pkgsrc-2015Q1, pkgsrc-2014Q4-base, pkgsrc-2014Q4, pkgsrc-2014Q3-base, pkgsrc-2014Q3, pkgsrc-2014Q2-base, pkgsrc-2014Q2, pkgsrc-2014Q1-base, pkgsrc-2014Q1, pkgsrc-2013Q4-base, pkgsrc-2013Q4, pkgsrc-2013Q3-base, pkgsrc-2013Q3, pkgsrc-2013Q2-base, pkgsrc-2013Q2, pkgsrc-2013Q1-base, pkgsrc-2013Q1, HEAD
Changes since 1.2: +21 -3 lines

NetBSD/current needs sysctl/vmmeter.h explicitly included.

$NetBSD: patch-af,v 1.3 2013/01/11 00:05:05 joerg Exp $

use the correct type for physmem

--- client/netbsd-meminfo.c.orig	2011-07-31 21:01:52.000000000 +0000
+++ client/netbsd-meminfo.c
@@ -15,14 +15,16 @@ static char rcsid[] = "$Id: netbsd-memin
 #include <sys/types.h>
 #include <sys/sysctl.h>
 #include <sys/swap.h>
+#include <sys/vmmeter.h>
 #include <unistd.h>
+#include <stdint.h>
 #include <stdlib.h>
 #include <stdio.h>
 
 int main(int argc, char *argv[])
 {
 	int hw_physmem[] = { CTL_HW, HW_PHYSMEM64 };
-	int64 physmem;
+	int64_t physmem;
 
 	int hw_pagesize[] = { CTL_HW, HW_PAGESIZE };
 	int pagesize;
@@ -64,7 +66,7 @@ int main(int argc, char *argv[])
 	swapused /= (2*1024);
 
 	// printf("Pagesize:%d\n", pagesize);
-	printf("Total:%d\n", (physmem / (1024 * 1024)));
+	printf("Total:%" PRId64"\n", (physmem / (1024 * 1024)));
 	printf("Free:%d\n", (pagesize / 1024)*(vmdata.t_free / 1024));
 	printf("Swaptotal:%lu\n", swaptotal);
 	printf("Swapused:%lu\n", swapused);