Ai
1 Star 0 Fork 16

wuxiaolei/libqb

forked from src-openEuler/libqb 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Change-assert-in-ringbuffer-to-a-return-code-492.patch 1.14 KB
一键复制 编辑 原始数据 按行查看 历史
bixiaoyan 提交于 2023-11-20 11:08 +08:00 . Change assert in ringbuffer to a return code
From 9297df4e48c45123a5e4103b3fd07df244346636 Mon Sep 17 00:00:00 2001
From: Chrissie Caulfield <ccaulfie@redhat.com>
Date: Wed, 15 Nov 2023 09:03:52 +0000
Subject: [PATCH] Change assert in ringbuffer to a return code (#492)
Why just this one?
There are LOADS of asserts in libqb, some are OK and some may be
overkill. This one in particular is causing CI failures
and so annoys me more than the rest.
---
lib/ringbuffer_helper.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/ringbuffer_helper.c b/lib/ringbuffer_helper.c
index dbde275..11795ff 100644
--- a/lib/ringbuffer_helper.c
+++ b/lib/ringbuffer_helper.c
@@ -359,7 +359,11 @@ qb_rb_close_helper(struct qb_ringbuffer_s * rb, int32_t unlink_it,
truncate_fallback);
/* the dirname part is assumed to be the same */
- assert(!strncmp(dir_path, hdr_path, sep - data_path));
+ if (strncmp(dir_path, hdr_path, sep - data_path)) {
+ qb_util_perror(LOG_DEBUG,
+ "header path is corrupted: %s", hdr_path);
+ res = -ENXIO;
+ }
sep = hdr_path + (sep - data_path);
/* now, don't touch neither data_path nor hdr_path */
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wuxiaolei1208/libqb.git
git@gitee.com:wuxiaolei1208/libqb.git
wuxiaolei1208
libqb
libqb
master

搜索帮助