summaryrefslogtreecommitdiffstats
path: root/src/nspawn
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2024-11-25 12:18:14 +0100
committerLennart Poettering <lennart@poettering.net>2024-12-19 15:32:50 +0100
commit5229cd839a0034f2f3ecb06a8b3f6fd2ded825b0 (patch)
tree13623d5d54c4657b2e3cea6c81ea9c5826be5c8a /src/nspawn
parentnspawn: use DEVNUM_FORMAT_STR/DEVNUM_FORMAT_VAL more (diff)
downloadsystemd-5229cd839a0034f2f3ecb06a8b3f6fd2ded825b0.tar.xz
systemd-5229cd839a0034f2f3ecb06a8b3f6fd2ded825b0.zip
nspawn: rename 'fd' variable to something more descriptive
Diffstat (limited to 'src/nspawn')
-rw-r--r--src/nspawn/nspawn.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index fbddc5948b..74e9fa04bd 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");