mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 19:04:45 +03:00
Add ShellCheck's --enable=all inside scripts/
Strengthen static code analysis for shell scripts. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: John Kennedy <john.kennedy@delphix.com> Signed-off-by: szubersk <szuberskidamian@gmail.com> Closes #12914
This commit is contained in:
+7
-5
@@ -102,10 +102,12 @@ function core_file
|
||||
|
||||
function core_prog
|
||||
{
|
||||
# shellcheck disable=SC2154
|
||||
prog=$ZTEST
|
||||
core_id=$($GDB --batch -c "$1" | grep "Core was generated by" | \
|
||||
tr \' ' ')
|
||||
if [[ "$core_id" == *"zdb "* ]]; then
|
||||
# shellcheck disable=SC2154
|
||||
prog=$ZDB
|
||||
fi
|
||||
printf "%s" "$prog"
|
||||
@@ -130,7 +132,7 @@ function store_core
|
||||
or_die mkdir -p "$dest/vdev"
|
||||
|
||||
if [[ $symlink -ne 0 ]]; then
|
||||
or_die ln -sf "$dest" ztest.core.$foundcrashes
|
||||
or_die ln -sf "$dest" "ztest.core.${foundcrashes}"
|
||||
fi
|
||||
|
||||
echo "*** ztest crash found - moving logs to $dest"
|
||||
@@ -195,10 +197,10 @@ while getopts ":ht:m:I:s:c:f:l" opt; do
|
||||
case $opt in
|
||||
t ) [[ $OPTARG -gt 0 ]] && timeout=$OPTARG ;;
|
||||
m ) [[ $OPTARG -gt 0 ]] && coremax=$OPTARG ;;
|
||||
I ) [[ $OPTARG ]] && iterations=$OPTARG ;;
|
||||
s ) [[ $OPTARG ]] && size=$OPTARG ;;
|
||||
c ) [[ $OPTARG ]] && coredir=$OPTARG ;;
|
||||
f ) [[ $OPTARG ]] && basedir=$(readlink -f "$OPTARG") ;;
|
||||
I ) [[ -n $OPTARG ]] && iterations=$OPTARG ;;
|
||||
s ) [[ -n $OPTARG ]] && size=$OPTARG ;;
|
||||
c ) [[ -n $OPTARG ]] && coredir=$OPTARG ;;
|
||||
f ) [[ -n $OPTARG ]] && basedir=$(readlink -f "$OPTARG") ;;
|
||||
l ) symlink=1 ;;
|
||||
h ) usage
|
||||
exit 2
|
||||
|
||||
Reference in New Issue
Block a user