diff options
author | Masatake YAMATO <yamato@redhat.com> | 2024-04-11 11:49:21 +0900 |
---|---|---|
committer | Masatake YAMATO <yamato@redhat.com> | 2024-04-15 18:18:01 +0900 |
commit | 5aa0c75c78dfb6a0c9851b348ba778149a4550a5 (patch) | |
tree | 479226de1e46299de2279a780fcf95596407575c | |
parent | d4dea14933bc3ee750d6762a6f615d2a4fe24c34 (diff) | |
download | util-linux-5aa0c75c78dfb6a0c9851b348ba778149a4550a5.tar.gz |
tests: (lsfd) don't refer "$?" on the line follwoing the use of "local"
Suggested by ShellCheck.
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
-rw-r--r-- | tests/ts/lsfd/lsfd-functions.bash | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/ts/lsfd/lsfd-functions.bash b/tests/ts/lsfd/lsfd-functions.bash index 533c25faed..9c2eb0785b 100644 --- a/tests/ts/lsfd/lsfd-functions.bash +++ b/tests/ts/lsfd/lsfd-functions.bash @@ -40,13 +40,18 @@ function lsfd_compare_dev { ts_check_prog "expr" ts_check_prog "stat" - local DEV=$("${LSFD}" --raw -n -o DEV -Q "${EXPR}") + local DEV + DEV=$("${LSFD}" --raw -n -o DEV -Q "${EXPR}") echo 'DEV[RUN]:' $? + local MAJ=${DEV%:*} local MIN=${DEV#*:} local DEVNUM=$(ts_makedev "$MAJ" "$MIN") - local STAT_DEVNUM=$(stat -c "%d" "$FILE") + + local STAT_DEVNUM + STAT_DEVNUM=$(stat -c "%d" "$FILE") echo 'STAT[RUN]:' $? + if [ "${DEVNUM}" == "${STAT_DEVNUM}" ]; then echo 'DEVNUM[STR]:' 0 else |