mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 19:57:43 +03:00
Enable shellcheck to run for select scripts
Enable shellcheck to run on zed scripts, paxcheck.sh, zfs-tests.sh, zfs.sh, and zloop.sh. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Signed-off-by: Giuseppe Di Natale <dinatale2@llnl.gov> Closes #5812
This commit is contained in:
committed by
Brian Behlendorf
parent
9b77d1c958
commit
c552fbc5f0
@@ -1,3 +1,5 @@
|
||||
#!/bin/sh
|
||||
# shellcheck disable=SC2039
|
||||
# zed-functions.sh
|
||||
#
|
||||
# ZED helper functions for use in ZEDLETs
|
||||
@@ -126,6 +128,7 @@ zed_lock()
|
||||
#
|
||||
eval "exec ${fd}> '${lockfile}'"
|
||||
err="$(flock --exclusive "${fd}" 2>&1)"
|
||||
# shellcheck disable=SC2181
|
||||
if [ $? -ne 0 ]; then
|
||||
zed_log_err "failed to lock \"${lockfile}\": ${err}"
|
||||
fi
|
||||
@@ -162,8 +165,8 @@ zed_unlock()
|
||||
fi
|
||||
|
||||
# Release the lock and close the file descriptor.
|
||||
#
|
||||
err="$(flock --unlock "${fd}" 2>&1)"
|
||||
# shellcheck disable=SC2181
|
||||
if [ $? -ne 0 ]; then
|
||||
zed_log_err "failed to unlock \"${lockfile}\": ${err}"
|
||||
fi
|
||||
@@ -424,14 +427,14 @@ zed_rate_limit()
|
||||
# Return
|
||||
# Pool name
|
||||
#
|
||||
function zed_guid_to_pool
|
||||
zed_guid_to_pool()
|
||||
{
|
||||
if [ -z "$1" ] ; then
|
||||
return
|
||||
fi
|
||||
|
||||
guid=$(printf "%llu" $1)
|
||||
guid=$(printf "%llu" "$1")
|
||||
if [ ! -z "$guid" ] ; then
|
||||
$ZPOOL get -H -ovalue,name guid | awk '$1=='$guid' {print $2}'
|
||||
$ZPOOL get -H -ovalue,name guid | awk '$1=='"$guid"' {print $2}'
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user