fix: another attempt to avoid sigpipe on grep (#519)

Take this opportunity to factorize all the greps in /proc/cpuinfo
into a helper that avoids using a pipe to entirely avoid SIGPIPE
on a possibly gigantic /proc/cpuinfo

(cherry picked from commit 5bbffaf053)
This commit is contained in:
Stéphane Lesimple
2026-08-08 17:23:47 +00:00
parent cb48e1ace8
commit cc29aaba6b
8 changed files with 25 additions and 19 deletions
+1 -1
View File
@@ -138,7 +138,7 @@ check_mds_linux() {
if is_x86_kernel; then
pr_info_nol "* Kernel supports using MD_CLEAR mitigation: "
kernel_md_clear_can_tell=1
if [ "$g_mode" = live ] && grep ^flags "$g_procfs/cpuinfo" | grep -qw md_clear; then
if [ "$g_mode" = live ] && cpuinfo_has_flag md_clear; then
kernel_md_clear="md_clear found in $g_procfs/cpuinfo"
pstatus green YES "$kernel_md_clear"
fi