fix: dmesg_grep: avoid sigpipe on some systems (#519)

built from commit cc159fe7fd
 dated 2026-06-08 21:41:08 +0200
 by Stéphane Lesimple (speed47_github@speed47.net)

 Use 'grep -m 1' (works under Linux, busybox, BSD) instead of piping to head -n1
This commit is contained in:
github-actions[bot]
2026-06-08 19:42:39 +00:00
parent 7847c95208
commit 476ebe59fc
+2 -2
View File
@@ -13,7 +13,7 @@
#
# Stephane Lesimple
#
VERSION='26.36.0606627'
VERSION='26.36.0608820'
# --- Common paths and basedirs ---
readonly VULN_SYSFS_BASE="/sys/devices/system/cpu/vulnerabilities"
@@ -3535,7 +3535,7 @@ dmesg_grep() {
# dmesg truncated
return 2
fi
ret_dmesg_grep_grepped=$(dmesg 2>/dev/null | grep -E "$1" | head -n1)
ret_dmesg_grep_grepped=$(dmesg 2>/dev/null | grep -m 1 -E "$1")
# not found:
[ -z "$ret_dmesg_grep_grepped" ] && return 1
# found, output is in $ret_dmesg_grep_grepped