sysctlbyname(3) returns -1 on failure, not any other value < 0.

This commit is contained in:
Juli Mallett 2002-06-06 20:59:15 +00:00
parent 48849938e8
commit 4049699b95
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=97964

View File

@ -59,13 +59,13 @@ donlist(void)
size_t oldlen;
oldlen = sizeof(ccpu);
if (sysctlbyname("kern.ccpu", &ccpu, &oldlen, NULL, 0) < 0)
if (sysctlbyname("kern.ccpu", &ccpu, &oldlen, NULL, 0) == -1)
return (1);
oldlen = sizeof(fscale);
if (sysctlbyname("kern.fscale", &fscale, &oldlen, NULL, 0) < 0)
if (sysctlbyname("kern.fscale", &fscale, &oldlen, NULL, 0) == -1)
return (1);
oldlen = sizeof(mempages);
if (sysctlbyname("hw.availpages", &mempages, &oldlen, NULL, 0) < 0)
if (sysctlbyname("hw.availpages", &mempages, &oldlen, NULL, 0) == -1)
return (1);
nlistread = 1;
return (0);