From 7fa08d415283c9a0c1e2b57edfbb13d722c25735 Mon Sep 17 00:00:00 2001 From: Olivier Certner Date: Tue, 21 Nov 2023 18:33:08 +0100 Subject: [PATCH] kern_racct.c: Don't compile if RACCT undefined Just skip compiling this file if RACCT isn't defined. This allows to skip including headers that no code uses at all, and also to remove the whole file's #ifdef/#endif bracketing. Reviewed by: markj MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/conf/files | 2 +- sys/kern/kern_racct.c | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index c5cd70415931..7ffcbe6e0dda 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -3795,7 +3795,7 @@ kern/kern_priv.c standard kern/kern_proc.c standard kern/kern_procctl.c standard kern/kern_prot.c standard -kern/kern_racct.c standard +kern/kern_racct.c optional racct kern/kern_rangelock.c standard kern/kern_rctl.c standard kern/kern_resource.c standard diff --git a/sys/kern/kern_racct.c b/sys/kern/kern_racct.c index 37b77243fe0e..43c3da0c2320 100644 --- a/sys/kern/kern_racct.c +++ b/sys/kern/kern_racct.c @@ -59,8 +59,6 @@ #include #endif -#ifdef RACCT - FEATURE(racct, "Resource Accounting"); /* @@ -1364,5 +1362,3 @@ racct_init(void) prison0.pr_prison_racct = prison_racct_find("0"); } SYSINIT(racct, SI_SUB_RACCT, SI_ORDER_FIRST, racct_init, NULL); - -#endif /* !RACCT */