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

