6 Star 5 Fork 55

OpenHarmony/third_party_e2fsprogs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
0020-tune2fs-tune2fs_main-should-return-rc-when-some-erro.patch 1.17 KB
一键复制 编辑 原始数据 按行查看 历史
wangmingxuan 提交于 2024-01-03 11:33 . e2fsprogs升级
From 77ac16dfba42e0d152b1e99359e01a933f8cc6f9 Mon Sep 17 00:00:00 2001
From: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Date: Mon, 5 Sep 2022 23:40:01 +0800
Subject: [PATCH] tune2fs: tune2fs_main() should return rc when some error,
occurs
If some error occurs, tune2fs_main() will go to closefs tag for
releasing resource, and it should return correct value (rc) instead
of 0 when ext2fs_close_free(&fs) successes.
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Reviewed-by: Artem Blagodarenko <artem.blagodarenko@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
misc/tune2fs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index 98e38983..bed3d95b 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -3243,6 +3243,7 @@ _("Warning: The journal is dirty. You may wish to replay the journal like:\n\n"
fputs(_("Error in using clear_mmp. "
"It must be used with -f\n"),
stderr);
+ rc = 1;
goto closefs;
}
}
@@ -3447,5 +3448,5 @@ closefs:
if (feature_64bit)
convert_64bit(fs, feature_64bit);
- return (ext2fs_close_free(&fs) ? 1 : 0);
+ return (ext2fs_close_free(&fs) ? 1 : rc);
}
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openharmony/third_party_e2fsprogs.git
git@gitee.com:openharmony/third_party_e2fsprogs.git
openharmony
third_party_e2fsprogs
third_party_e2fsprogs
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385