代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/rsyslog 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 640af90afaf13bef5a99a458ed8e862359588d8f Mon Sep 17 00:00:00 2001
From: Kailash Sethuraman <hsaliak@gmail.com>
Date: Thu, 13 Jan 2022 13:52:46 -0500
Subject: [PATCH] Fixes #4395 by correctly checking for EPIPE.
kmsg is a unique device, which can recover from EPIPE errors.
The original code checked for this, but checked the return value for the libc
read call, which always returns -1 and sets the appropriate errno.
This meant that when an EPIPE error actually happened, the fd was infinitely retried. The 'for loop' was broken out of, but the readikmsg() function is repeatedly called.
Note: there is an additional bug here. The readikmsg function needs better error checking on the fd. I suspect that this was rarely an issue because /dev/kmsg goes truly invalid when the system is actually shutting down.
The fix here is to check the return value as well as the errno.
Conflict:NA
Reference:https://github.com/rsyslog/rsyslog/commit/feb6420148c351072a190990622b58124fd44506
---
contrib/imkmsg/kmsg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/imkmsg/kmsg.c b/contrib/imkmsg/kmsg.c
index beb4076..5a3f45e 100644
--- a/contrib/imkmsg/kmsg.c
+++ b/contrib/imkmsg/kmsg.c
@@ -214,7 +214,7 @@ readkmsg(void)
if (i > 0) {
/* successful read of message of nonzero length */
pRcv[i] = '\0';
- } else if (i == -EPIPE) {
+ } else if (i < 0 && errno == EPIPE) {
imkmsgLogIntMsg(LOG_WARNING,
"imkmsg: some messages in circular buffer got overwritten");
continue;
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。