mirror of
https://github.com/speed47/spectre-meltdown-checker.git
synced 2026-06-10 00:23:06 +02:00
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:
@@ -13,7 +13,7 @@
|
|||||||
#
|
#
|
||||||
# Stephane Lesimple
|
# Stephane Lesimple
|
||||||
#
|
#
|
||||||
VERSION='26.36.0606627'
|
VERSION='26.36.0608820'
|
||||||
|
|
||||||
# --- Common paths and basedirs ---
|
# --- Common paths and basedirs ---
|
||||||
readonly VULN_SYSFS_BASE="/sys/devices/system/cpu/vulnerabilities"
|
readonly VULN_SYSFS_BASE="/sys/devices/system/cpu/vulnerabilities"
|
||||||
@@ -3535,7 +3535,7 @@ dmesg_grep() {
|
|||||||
# dmesg truncated
|
# dmesg truncated
|
||||||
return 2
|
return 2
|
||||||
fi
|
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:
|
# not found:
|
||||||
[ -z "$ret_dmesg_grep_grepped" ] && return 1
|
[ -z "$ret_dmesg_grep_grepped" ] && return 1
|
||||||
# found, output is in $ret_dmesg_grep_grepped
|
# found, output is in $ret_dmesg_grep_grepped
|
||||||
|
|||||||
Reference in New Issue
Block a user