1 Star 0 Fork 71

梓瑶/libvirt

forked from src-openEuler/libvirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
logging-fix-endless-loop-on-EOF.patch 1.06 KB
一键复制 编辑 原始数据 按行查看 历史
From 8a4f9cab7d08bf13ac794fa2800a37c59ac14728 Mon Sep 17 00:00:00 2001
From: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Date: Thu, 24 Sep 2020 15:54:24 +0300
Subject: [PATCH 033/108] logging: fix endless loop on EOF
On EOF condition we always have POLLHUP event and read returns
0 thus we never break loop in virLogHandlerDomainLogFileDrain.
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit bde9e2c6c018f79d8e3b0bd30ea7aa80dcc9e435)
---
src/logging/log_handler.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/logging/log_handler.c b/src/logging/log_handler.c
index 87748d96d1..3cc197a396 100644
--- a/src/logging/log_handler.c
+++ b/src/logging/log_handler.c
@@ -464,6 +464,8 @@ virLogHandlerDomainLogFileDrain(virLogHandlerLogFilePtr file)
if (errno == EINTR)
continue;
return;
+ } else if (len == 0) {
+ return;
}
if (virRotatingFileWriterAppend(file->file, buf, len) != len)
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ziyao233/libvirt.git
git@gitee.com:ziyao233/libvirt.git
ziyao233
libvirt
libvirt
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385