If sysctlbyname fails for kernel related reasons, tag the errno

string to the end of the error message. I think we used errx()
there when we really wanted an err().

MFC after:	1 week
This commit is contained in:
Christian S.J. Peron 2005-05-24 23:42:09 +00:00
parent ab19e37ab0
commit 701fabc74b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=146602

View File

@ -568,7 +568,7 @@ sysctlgatherstruct(void *addr, size_t size, struct scgs_vector *vecarr)
rv = sysctlbyname(xp->sysctl, (char *)addr + xp->offset,
&tsiz, NULL, 0);
if (rv == -1)
errx(1, "sysctlbyname: %s", xp->sysctl);
err(1, "sysctlbyname: %s", xp->sysctl);
if (tsiz != xp->size)
errx(1, "%s size mismatch (expected %d, got %d)",
xp->sysctl, xp->size, tsiz);