加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-coredump-fix-filename-in-journal-when-not-compressed.patch 1.22 KB
一键复制 编辑 原始数据 按行查看 历史
From 01cf580c235ac4725051e6101ce5bcef1b97cc48 Mon Sep 17 00:00:00 2001
From: xdavidwu <xdavidwuph@gmail.com>
Date: Fri, 5 Nov 2021 22:37:06 +0800
Subject: [PATCH] coredump: fix filename in journal when not compressed
Since 587f2a5e564cf434c2e0a653f52b8f73e86092d8, filename for
not-compressed coredump is missing from save_external_coredump, making
it write COREDUMP_FILENAME= (empty) in journal, making `coredumpctl`
report it missing but it is actually saved.
This fixes it.
(cherry picked from commit 0cfb0971f0fcd345cae76f6837d9801b6cbde407)
Conflict:NA
Reference:https://github.com/systemd/systemd/commit/01cf580c235ac4725051e6101ce5bcef1b97cc48
---
src/coredump/coredump.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c
index 444b9ec374..1e34c4b5be 100644
--- a/src/coredump/coredump.c
+++ b/src/coredump/coredump.c
@@ -525,6 +525,7 @@ static int save_external_coredump(
if (lseek(fd, 0, SEEK_SET) == (off_t) -1)
return log_error_errno(errno, "Failed to seek on coredump %s: %m", fn);
+ *ret_filename = TAKE_PTR(fn);
*ret_data_fd = TAKE_FD(fd);
*ret_size = (uint64_t) st.st_size;
*ret_truncated = truncated;
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化