From: Michal Sekletar Date: Mon, 9 Sep 2024 16:31:57 +0000 (+0200) Subject: coredump: store actual fd in appropriate variable X-Git-Tag: v257-rc1~99^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84289ab90fe36fa661a9b4420d70566d4eaa97ed;p=thirdparty%2Fsystemd.git coredump: store actual fd in appropriate variable --- diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c index 0900689d042..c15189b4ea6 100644 --- a/src/coredump/coredump.c +++ b/src/coredump/coredump.c @@ -1691,13 +1691,13 @@ static int gather_pid_mount_tree_fd(const Context *context) { if (r == 0) { pair[0] = safe_close(pair[0]); - r = open_tree(-EBADF, "/", AT_NO_AUTOMOUNT | AT_RECURSIVE | AT_SYMLINK_NOFOLLOW | OPEN_TREE_CLOEXEC | OPEN_TREE_CLONE); - if (r < 0) { + fd = open_tree(-EBADF, "/", AT_NO_AUTOMOUNT | AT_RECURSIVE | AT_SYMLINK_NOFOLLOW | OPEN_TREE_CLOEXEC | OPEN_TREE_CLONE); + if (fd < 0) { log_error_errno(errno, "Failed to clone mount tree: %m"); _exit(EXIT_FAILURE); } - r = send_one_fd(pair[1], r, 0); + r = send_one_fd(pair[1], fd, 0); if (r < 0) { log_error_errno(r, "Failed to send mount tree to parent: %m"); _exit(EXIT_FAILURE);