13 Star 2 Fork 54

src-openEuler/util-linux

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-tests-lsfd-don-t-refer-on-the-line-follwoing-the-use.patch 1.18 KB
一键复制 编辑 原始数据 按行查看 历史
From 5aa0c75c78dfb6a0c9851b348ba778149a4550a5 Mon Sep 17 00:00:00 2001
From: Masatake YAMATO <yamato@redhat.com>
Date: Thu, 11 Apr 2024 11:49:21 +0900
Subject: [PATCH] tests: (lsfd) don't refer "$?" on the line follwoing the use
of "local"
Suggested by ShellCheck.
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
---
tests/ts/lsfd/lsfd-functions.bash | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/tests/ts/lsfd/lsfd-functions.bash b/tests/ts/lsfd/lsfd-functions.bash
index 533c25fae..9c2eb0785 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
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/util-linux.git
git@gitee.com:src-openeuler/util-linux.git
src-openeuler
util-linux
util-linux
master

搜索帮助