From: henning Date: Thu, 24 Jul 2008 10:52:43 +0000 (+0000) Subject: check sysctl return value X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3c84041b47b6cf6b2bc433ebf921b9eb8ae4363b;p=openbsd check sysctl return value From: Gleydson Soares , ryan ok --- diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 76b6e793b76..f01b6a92717 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl.c,v 1.276 2008/05/27 08:14:57 mcbride Exp $ */ +/* $OpenBSD: pfctl.c,v 1.277 2008/07/24 10:52:43 henning Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -1573,7 +1573,8 @@ pfctl_init_options(struct pfctl *pf) mib[0] = CTL_HW; mib[1] = HW_PHYSMEM64; size = sizeof(mem); - (void) sysctl(mib, 2, &mem, &size, NULL, 0); + if (sysctl(mib, 2, &mem, &size, NULL, 0) == -1) + err(1, "sysctl"); if (mem <= 100*1024*1024) pf->limit[PF_LIMIT_TABLE_ENTRIES] = PFR_KENTRY_HIWAT_SMALL;