$OpenBSD: patch-src_libs_zbxsysinfo_openbsd_swap_c,v 1.2 2014/01/14 15:17:46 robert Exp $
--- src/libs/zbxsysinfo/openbsd/swap.c.orig	Tue Jan 14 09:18:20 2014
+++ src/libs/zbxsysinfo/openbsd/swap.c	Tue Jan 14 09:20:29 2014
@@ -144,7 +144,7 @@ int	SYSTEM_SWAP_SIZE(AGENT_REQUEST *request, AGENT_RES
 	return ret;
 }
 
-static int	get_swap_io(zbx_uint64_t *icount, zbx_uint64_t *ipages, zbx_uint64_t *ocount, zbx_uint64_t *opages)
+static int	get_swap_io(zbx_uint64_t *ipages, zbx_uint64_t *opages)
 {
 	int		mib[2];
 	size_t		len;
@@ -158,17 +158,11 @@ static int	get_swap_io(zbx_uint64_t *icount, zbx_uint6
 	if (0 != sysctl(mib, 2, &v, &len, NULL, 0))
 		return SYSINFO_RET_FAIL;
 
-	/* int swapins;		swapins */
-	/* int swapouts;	swapouts */
 	/* int pgswapin;	pages swapped in */
 	/* int pgswapout;	pages swapped out */
 
-	if (icount)
-		*icount = (zbx_uint64_t)v.swapins;
 	if (ipages)
 		*ipages = (zbx_uint64_t)v.pgswapin;
-	if (ocount)
-		*ocount = (zbx_uint64_t)v.swapouts;
 	if (opages)
 		*opages = (zbx_uint64_t)v.pgswapout;
 
@@ -190,17 +184,11 @@ int	SYSTEM_SWAP_IN(AGENT_REQUEST *request, AGENT_RESUL
 	if (NULL != swapdev && '\0' != *swapdev && 0 != strcmp(swapdev, "all"))
 		return SYSINFO_RET_FAIL;
 
-	/* default parameter */
-	if (NULL == mode || '\0' == *mode || 0 == strcmp(mode, "count"))
+	if (0 == strcmp(mode, "pages"))
 	{
-		if (SYSINFO_RET_OK != get_swap_io(&value, NULL, NULL, NULL))
+		if (SYSINFO_RET_OK != get_swap_io(NULL, &value))
 			return SYSINFO_RET_FAIL;
 	}
-	else if (0 == strcmp(mode, "pages"))
-	{
-		if (SYSINFO_RET_OK != get_swap_io(NULL, &value, NULL, NULL))
-			return SYSINFO_RET_FAIL;
-	}
 	else
 		return SYSINFO_RET_FAIL;
 
@@ -224,15 +212,9 @@ int	SYSTEM_SWAP_OUT(AGENT_REQUEST *request, AGENT_RESU
 	if (NULL != swapdev && '\0' != *swapdev && 0 != strcmp(swapdev, "all"))
 		return SYSINFO_RET_FAIL;
 
-	/* default parameter */
-	if (NULL == mode || '\0' == *mode || 0 == strcmp(mode, "count"))
+	if (0 == strcmp(mode, "pages"))
 	{
-		if (SYSINFO_RET_OK != get_swap_io(NULL, NULL, &value, NULL))
-			return SYSINFO_RET_FAIL;
-	}
-	else if (0 == strcmp(mode, "pages"))
-	{
-		if (SYSINFO_RET_OK != get_swap_io(NULL, NULL, NULL, &value))
+		if (SYSINFO_RET_OK != get_swap_io(NULL, &value))
 			return SYSINFO_RET_FAIL;
 	}
 	else
