1 Star 0 Fork 28

Sdrkun/kmod

forked from src-openEuler/kmod 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-libkmod-allow-modules.alias.builtin-to-be-optional.patch 1.16 KB
一键复制 编辑 原始数据 按行查看 历史
From d8d1d54051053d770643b59c3f5cf5608a17a0ce Mon Sep 17 00:00:00 2001
From: Lucas De Marchi <[email protected]>
Date: Mon, 9 Mar 2020 22:00:28 -0700
Subject: [PATCH] libkmod: allow modules.alias.builtin to be optional
---
libkmod/libkmod.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/libkmod/libkmod.c b/libkmod/libkmod.c
index ab5c1e8..43423d6 100644
--- a/libkmod/libkmod.c
+++ b/libkmod/libkmod.c
@@ -855,8 +855,8 @@ KMOD_EXPORT int kmod_validate_resources(struct kmod_ctx *ctx)
*/
KMOD_EXPORT int kmod_load_resources(struct kmod_ctx *ctx)
{
+ int ret = 0;
size_t i;
- int ret;
if (ctx == NULL)
return -ENOENT;
@@ -874,8 +874,17 @@ KMOD_EXPORT int kmod_load_resources(struct kmod_ctx *ctx)
index_files[i].fn);
ret = index_mm_open(ctx, path, &ctx->indexes_stamp[i],
&ctx->indexes[i]);
- if (ret)
- break;
+
+ /*
+ * modules.builtin.alias are considered optional since it's
+ * recently added and older installations may not have it;
+ * we allow failing for any reason
+ */
+ if (ret) {
+ if (i != KMOD_INDEX_MODULES_BUILTIN_ALIAS)
+ break;
+ ret = 0;
+ }
}
if (ret)
--
2.19.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sdrkun/kmod.git
[email protected]:sdrkun/kmod.git
sdrkun
kmod
kmod
master

搜索帮助