From ef99711d0f937dd258ffbc2a96455e72bd2528f6 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 25 Nov 2024 12:15:17 +0100 Subject: [PATCH] nspawn: drop some redundant {} --- src/nspawn/nspawn.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 1b452014e34..630b32c4a6a 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -2569,10 +2569,9 @@ static int setup_credentials(const char *root) { if (fchmod(fd, world_readable ? 0444 : 0400) < 0) return log_error_errno(errno, "Failed to adjust access mode of %s: %m", j); - if (arg_userns_mode != USER_NAMESPACE_NO) { + if (arg_userns_mode != USER_NAMESPACE_NO) if (fchown(fd, arg_uid_shift, arg_uid_shift) < 0) return log_error_errno(errno, "Failed to adjust ownership of %s: %m", j); - } } if (chmod(q, world_readable ? 0555 : 0500) < 0) @@ -3438,10 +3437,9 @@ static int inner_child( if (!arg_network_namespace_path && arg_private_network) { _cleanup_close_ int netns_fd = -EBADF; - if (arg_privileged) { + if (arg_privileged) if (unshare(CLONE_NEWNET) < 0) return log_error_errno(errno, "Failed to unshare network namespace: %m"); - } netns_fd = namespace_open_by_type(NAMESPACE_NET); if (netns_fd < 0) @@ -5078,7 +5076,7 @@ static int load_settings(void) { return 0; /* We first look in the admin's directories in /etc and /run */ - if (arg_privileged) { + if (arg_privileged) FOREACH_STRING(i, "/etc/systemd/nspawn", "/run/systemd/nspawn") { _cleanup_free_ char *j = NULL; @@ -5100,7 +5098,6 @@ static int load_settings(void) { if (errno != ENOENT) return log_error_errno(errno, "Failed to open %s: %m", j); } - } if (!f) { /* After that, let's look for a file next to the -- 2.47.3