From 5229cd839a0034f2f3ecb06a8b3f6fd2ded825b0 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 25 Nov 2024 12:18:14 +0100 Subject: [PATCH] nspawn: rename 'fd' variable to something more descriptive --- src/nspawn/nspawn.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index fbddc5948b0..74e9fa04bd5 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -3933,7 +3933,7 @@ static int outer_child( _cleanup_(bind_user_context_freep) BindUserContext *bind_user_context = NULL; _cleanup_strv_free_ char **os_release_pairs = NULL; - _cleanup_close_ int fd = -EBADF, mntns_fd = -EBADF; + _cleanup_close_ int mntns_fd = -EBADF; bool idmap = false, enable_fuse; const char *p; pid_t pid; @@ -4326,6 +4326,7 @@ static int outer_child( * visible. Hence there we do it the other way round: we first allocate a new set of namespaces * (and fork for it) for which we then mount sysfs/procfs, and only then switch root. */ + _cleanup_close_ int notify_fd = -EBADF; if (arg_privileged) { /* Mark everything as shared so our mounts get propagated down. This is required to make new * bind mounts available in systemd services inside the container that create a new mount @@ -4361,11 +4362,11 @@ static int outer_child( return r; } - fd = setup_notify_child(NULL); + notify_fd = setup_notify_child(NULL); } else - fd = setup_notify_child(directory); - if (fd < 0) - return fd; + notify_fd = setup_notify_child(directory); + if (notify_fd < 0) + return notify_fd; pid = raw_clone(SIGCHLD|CLONE_NEWNS| arg_clone_ns_flags | @@ -4430,7 +4431,7 @@ static int outer_child( return log_error_errno(SYNTHETIC_ERRNO(EIO), "Short write while sending machine ID."); - l = send_one_fd(fd_outer_socket, fd, 0); + l = send_one_fd(fd_outer_socket, notify_fd, 0); if (l < 0) return log_error_errno(l, "Failed to send notify fd: %m"); -- 2.47.3