audit: change audit_syscalls_enabled type to bool

So that it fits better in __read_frequently.

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
mjg 2018-11-29 08:37:33 +00:00
parent e3ed27c285
commit d1c87d3896
2 changed files with 6 additions and 6 deletions

View File

@ -103,7 +103,7 @@ int audit_trail_suspended;
#ifdef KDTRACE_HOOKS
u_int audit_dtrace_enabled;
#endif
int __read_frequently audit_syscalls_enabled;
bool __read_frequently audit_syscalls_enabled;
/*
* Flags controlling behavior in low storage situations. Should we panic if
@ -216,13 +216,13 @@ audit_syscalls_enabled_update(void)
mtx_lock(&audit_mtx);
#ifdef KDTRACE_HOOKS
if (audit_dtrace_enabled)
audit_syscalls_enabled = 1;
audit_syscalls_enabled = true;
else {
#endif
if (audit_trail_enabled && !audit_trail_suspended)
audit_syscalls_enabled = 1;
audit_syscalls_enabled = true;
else
audit_syscalls_enabled = 0;
audit_syscalls_enabled = false;
#ifdef KDTRACE_HOOKS
}
#endif
@ -336,7 +336,7 @@ audit_init(void)
audit_trail_enabled = 0;
audit_trail_suspended = 0;
audit_syscalls_enabled = 0;
audit_syscalls_enabled = false;
audit_panic_on_write_fail = 0;
audit_fail_stop = 0;
audit_in_failure = 0;

View File

@ -71,7 +71,7 @@
extern u_int audit_dtrace_enabled;
extern int audit_trail_enabled;
extern int audit_trail_suspended;
extern int audit_syscalls_enabled;
extern bool audit_syscalls_enabled;
void audit_syscall_enter(unsigned short code, struct thread *td);
void audit_syscall_exit(int error, struct thread *td);