rctl: fix sysctl kern.racct.enable use after r341182
The value was changed from int to bool. Since the new type is smaller, the rest of the variable in the caller was left unitialized. PR: 236714 Reported by: trasz Diagnosed by: markj Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
fd29ff5d53
commit
0a17b9e03e
@ -378,8 +378,9 @@ print_rules(char *rules, int hflag, int nflag)
|
||||
static void
|
||||
enosys(void)
|
||||
{
|
||||
int error, racct_enable;
|
||||
size_t racct_enable_len;
|
||||
int error;
|
||||
bool racct_enable;
|
||||
|
||||
racct_enable_len = sizeof(racct_enable);
|
||||
error = sysctlbyname("kern.racct.enable",
|
||||
@ -392,7 +393,7 @@ enosys(void)
|
||||
err(1, "sysctlbyname");
|
||||
}
|
||||
|
||||
if (racct_enable == 0)
|
||||
if (!racct_enable)
|
||||
errx(1, "RACCT/RCTL present, but disabled; enable using kern.racct.enable=1 tunable");
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user