Skip to content

Commit 1fa09a8

Browse files
committed
Fix undeclared symbols in signal handler
Building with a custom toolchain (GCC 15, uClibc, kernel headers 5.10) fails in netlink.c with errors like these: pihole-ftl-6.5/src/signals.c:214:30: error: ‘BUS_MCEERR_AR’ undeclared (first use in this function) 214 | case BUS_MCEERR_AR: log_info(" with code: BUS_MCEERR_AR (Hardware memory error: action required)"); break; | ^~~~~~~~~~~~~ pihole-ftl-6.5/src/signals.c:214:30: note: each undeclared identifier is reported only once for each function it appears in pihole-ftl-6.5/src/signals.c:215:30: error: ‘BUS_MCEERR_AO’ undeclared (first use in this function) 215 | case BUS_MCEERR_AO: log_info(" with code: BUS_MCEERR_AO (Hardware memory error: action optional)"); break; | ^~~~~~~~~~~~~ Bracket undeclared symbols with precompiler directives. Signed-off-by: Andreas Ziegler <[email protected]>
1 parent e3a3b6e commit 1fa09a8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/signals.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,14 @@ static void __attribute__((noreturn)) signal_handler(int sig, siginfo_t *si, voi
211211
case BUS_ADRALN: log_info(" with code: BUS_ADRALN (Invalid address alignment)"); break;
212212
case BUS_ADRERR: log_info(" with code: BUS_ADRERR (Non-existent physical address)"); break;
213213
case BUS_OBJERR: log_info(" with code: BUS_OBJERR (Object specific hardware error)"); break;
214+
#if defined (BUS_MCEERR_AR)
215+
// 2025-May: not defined by uClibc
214216
case BUS_MCEERR_AR: log_info(" with code: BUS_MCEERR_AR (Hardware memory error: action required)"); break;
217+
#endif
218+
#if defined (BUS_MCEERR_AO)
219+
// 2025-May: not defined by uClibc
215220
case BUS_MCEERR_AO: log_info(" with code: BUS_MCEERR_AO (Hardware memory error: action optional)"); break;
221+
#endif
216222
default: log_info(" with code: Unknown (%i)", si->si_code); break;
217223
}
218224
}

0 commit comments

Comments
 (0)