nspawn: drop some redundant {}

This commit is contained in:
Lennart Poettering
2025-01-03 10:21:27 +01:00
parent 36d2096b84
commit ef99711d0f
+3 -6
View File
@@ -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