diff options
author | 2008-07-24 10:52:43 +0000 | |
---|---|---|
committer | 2008-07-24 10:52:43 +0000 | |
commit | 3c84041b47b6cf6b2bc433ebf921b9eb8ae4363b (patch) | |
tree | 4faf21be9612f924b95df8e50c61628aeb08ef16 | |
parent | unXXX prototypes: exp2, remquo, nan, exp2f, remquof, nanf (diff) | |
download | wireguard-openbsd-3c84041b47b6cf6b2bc433ebf921b9eb8ae4363b.tar.xz wireguard-openbsd-3c84041b47b6cf6b2bc433ebf921b9eb8ae4363b.zip |
check sysctl return value
From: Gleydson Soares <gsoares@gmail.com>, ryan ok
-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; |