]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
nspawn: drop some redundant {}
authorLennart Poettering <lennart@poettering.net>
Mon, 25 Nov 2024 11:15:17 +0000 (12:15 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 3 Jan 2025 09:21:27 +0000 (10:21 +0100)
src/nspawn/nspawn.c

index 1b452014e3473d4c0a71ef1dfaafea9cb5d1b47a..630b32c4a6a49467af25c28eed61208a1d82b344 100644 (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