diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2008-07-24 10:52:44 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2008-07-24 10:52:44 +0000 |
commit | ccd1502ec4ab9481ecccfcd36c216362531aed9d (patch) | |
tree | b200fc5628a844554cde8f57c88b6787cfba8623 /sbin | |
parent | 5a13226cae7f502defe75824315547c9c338eefa (diff) |
check sysctl return value
From: Gleydson Soares <gsoares@gmail.com>, ryan ok
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/pfctl/pfctl.c | 5 |
1 files changed, 3 insertions, 2 deletions
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; |