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:
csjp 2005-05-24 23:42:09 +00:00
parent f539b2792a
commit 377408df64

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);