]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: (lsfd) don't refer "$?" on the line follwoing the use of "local"
authorMasatake YAMATO <yamato@redhat.com>
Thu, 11 Apr 2024 02:49:21 +0000 (11:49 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Mon, 15 Apr 2024 09:18:01 +0000 (18:18 +0900)
Suggested by ShellCheck.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
tests/ts/lsfd/lsfd-functions.bash

index 533c25faed7977759f9d6a7395045fa95b7cbc20..9c2eb0785b3cd1c589bc582ffbd6f37623240362 100644 (file)
@@ -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