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)
Use 'grep -m 1' (works under Linux, busybox, BSD) instead of piping to head -n1
This commit is contained in:
@@ -9,7 +9,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