Skip to content

Commit

Permalink
hijack.sh: fail if the logger trace is empty
Browse files Browse the repository at this point in the history
Does not completely fixes #297 but goes a long way.

Signed-off-by: Marc Herbert <[email protected]>
  • Loading branch information
marc-hb committed Apr 23, 2021
1 parent d26a46c commit a207ff7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions case-lib/hijack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ function func_exit_handler()
# shellcheck disable=SC2154
wcLog=$(wc -l "$logfile")
dlogi "nlines=$wcLog"
local nlines; nlines=$(wc -l < "$logfile")
# Line 1 is the header
if [ "$nlines" -le 1 ]; then
dloge "Empty logger trace"
exit_status=1
fi
fi

if [[ "$KERNEL_CHECKPOINT" =~ ^[0-9]{10} ]]; then
Expand Down

0 comments on commit a207ff7

Please sign in to comment.