]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tree-wide: drop if braces around single line expressions as well 17273/head
authorFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 9 Oct 2020 13:06:34 +0000 (15:06 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 9 Oct 2020 13:11:55 +0000 (15:11 +0200)
13 files changed:
src/basic/btrfs-util.c
src/core/automount.c
src/core/execute.c
src/core/main.c
src/core/namespace.c
src/libsystemd-network/dhcp-identifier.c
src/libsystemd-network/sd-dhcp-client.c
src/libsystemd-network/sd-dhcp-lease.c
src/libsystemd-network/sd-dhcp6-client.c
src/network/networkctl.c
src/resolve/resolved-dns-query.c
src/run/run.c
src/shared/ptyfwd.c

index 43a58918e9d724f8fdab1e69fa674d27837557ec..50a35268ea1bbfd757142e51063b838cdaf2cd9b 100644 (file)
@@ -1393,13 +1393,12 @@ static int copy_quota_hierarchy(int fd, uint64_t old_subvol_id, uint64_t new_sub
                 }
 
                 for (j = 0; j < n_old_parent_qgroups; j++)
-                        if (old_parent_qgroups[j] == old_qgroups[i]) {
+                        if (old_parent_qgroups[j] == old_qgroups[i])
                                 /* The old subvolume shared a common
                                  * parent qgroup with its parent
                                  * subvolume. Let's set up something
                                  * similar in the destination. */
                                 copy_from_parent = true;
-                        }
         }
 
         if (!insert_intermediary_qgroup && !copy_from_parent)
index b0d43a3ef40ace0f3010cae6b95804855b82e123..9c0dca1b3a78c38fa82340a120e9a23fbb8623f1 100644 (file)
@@ -540,10 +540,8 @@ static void automount_trigger_notify(Unit *u, Unit *other) {
                    MOUNT_MOUNTED, MOUNT_REMOUNTING,
                    MOUNT_REMOUNTING_SIGTERM, MOUNT_REMOUNTING_SIGKILL,
                    MOUNT_UNMOUNTING_SIGTERM, MOUNT_UNMOUNTING_SIGKILL,
-                   MOUNT_FAILED)) {
-
+                   MOUNT_FAILED))
                 (void) automount_send_ready(a, a->expire_tokens, -ENODEV);
-        }
 
         if (MOUNT(other)->state == MOUNT_DEAD)
                 (void) automount_send_ready(a, a->expire_tokens, 0);
index 5264b8f0919fd219a2eaf45d5a8b7f48b8acb6d5..d21de8c41e054ba236e0f849b40d580286a77216 100644 (file)
@@ -5772,11 +5772,10 @@ void exec_status_start(ExecStatus *s, pid_t pid) {
 void exec_status_exit(ExecStatus *s, const ExecContext *context, pid_t pid, int code, int status) {
         assert(s);
 
-        if (s->pid != pid) {
+        if (s->pid != pid)
                 *s = (ExecStatus) {
                         .pid = pid,
                 };
-        }
 
         dual_timestamp_get(&s->exit_timestamp);
 
index 08504961a273d155b736c0f9b2e0c7a4ee3afdb3..6cd596fa79b323833271d265d8b9fc811ca6e2e9 100644 (file)
@@ -1562,7 +1562,7 @@ static void initialize_clock(void) {
                 else
                         log_info("RTC configured in localtime, applying delta of %i minutes to system time.", min);
 
-        } else if (!in_initrd()) {
+        } else if (!in_initrd())
                 /*
                  * Do a dummy very first call to seal the kernel's time warp magic.
                  *
@@ -1575,7 +1575,6 @@ static void initialize_clock(void) {
                  * be treated as UTC that way.
                  */
                 (void) clock_reset_timewarp();
-        }
 
         r = clock_apply_epoch();
         if (r < 0)
index 92df97c4fb2c700040210a32595262c72679c27e..05bd4da154455ff5b2fb02a1a08479c6fffd33d6 100644 (file)
@@ -1618,13 +1618,12 @@ int setup_namespace(
                 if (r < 0)
                         goto finish;
 
-                if (ns_info->private_dev) {
+                if (ns_info->private_dev)
                         *(m++) = (MountEntry) {
                                 .path_const = "/dev",
                                 .mode = PRIVATE_DEV,
                                 .flags = DEV_MOUNT_OPTIONS,
                         };
-                }
 
                 if (ns_info->protect_kernel_tunables) {
                         r = append_static_mounts(&m,
@@ -1653,12 +1652,11 @@ int setup_namespace(
                                 goto finish;
                 }
 
-                if (ns_info->protect_control_groups) {
+                if (ns_info->protect_control_groups)
                         *(m++) = (MountEntry) {
                                 .path_const = "/sys/fs/cgroup",
                                 .mode = READONLY,
                         };
-                }
 
                 r = append_protect_home(&m, ns_info->protect_home, ns_info->ignore_protect_paths);
                 if (r < 0)
index d0610a32e23d5defcca83889ea716bfb2a4e491e..e7dbec1511cd5f831f65e393218141e2325be398 100644 (file)
@@ -26,11 +26,10 @@ int dhcp_validate_duid_len(uint16_t duid_type, size_t duid_len, bool strict) {
         if (duid_len > MAX_DUID_LEN)
                 return -EINVAL;
 
-        if (!strict) {
+        if (!strict)
                 /* Strict validation is not requested. We only ensure that the
                  * DUID is not too long. */
                 return 0;
-        }
 
         switch (duid_type) {
         case DUID_TYPE_LLT:
index 265b6eab4436b46768b46f3ac996560e0f3ac9cf..1b622ce5a8f04eac440e8a491ee926adf2b05a39 100644 (file)
@@ -1880,12 +1880,11 @@ static int client_receive_message_udp(
         assert(client);
 
         buflen = next_datagram_size_fd(fd);
-        if (buflen == -ENETDOWN) {
+        if (buflen == -ENETDOWN)
                 /* the link is down. Don't return an error or the I/O event
                    source will be disconnected and we won't be able to receive
                    packets again when the link comes back. */
                 return 0;
-        }
         if (buflen < 0)
                 return buflen;
 
index 0aa6a63c0a99182977c430685a5d6385a6517e14..5f89d00452e640a8625e80c0be13af420fb9d41a 100644 (file)
@@ -1233,9 +1233,8 @@ int dhcp_lease_load(sd_dhcp_lease **ret, const char *lease_file) {
                 if (!a)
                         return -ENOMEM;
 
-                if (!strv_isempty(a)) {
+                if (!strv_isempty(a))
                         lease->search_domains = TAKE_PTR(a);
-                }
         }
 
         if (routes) {
index 38025b63d92ce7439d8f1551c37444760d3a5422..e1dbdaff4e78695315b23e80087f21c5f7b78844 100644 (file)
@@ -1420,12 +1420,11 @@ static int client_receive_message(
         assert(client->event);
 
         buflen = next_datagram_size_fd(fd);
-        if (buflen == -ENETDOWN) {
+        if (buflen == -ENETDOWN)
                 /* the link is down. Don't return an error or the I/O event
                    source will be disconnected and we won't be able to receive
                    packets again when the link comes back. */
                 return 0;
-        }
         if (buflen < 0)
                 return buflen;
 
index 0c4f93045f430e1b400f2215ae0c76f2b0aca34d..86e53e6da426647b94f4dea6e226a376f20face5 100644 (file)
@@ -1653,12 +1653,11 @@ static int link_status_one(
                 if (r < 0)
                         return table_log_add_error(r);
 
-                if (info->port_state <= BR_STATE_BLOCKING) {
+                if (info->port_state <= BR_STATE_BLOCKING)
                         r = table_add_many(table,
                                            TABLE_EMPTY,
                                            TABLE_STRING, "Port State:",
                                            TABLE_STRING, bridge_state_to_string(info->port_state));
-                }
         } else if (streq_ptr(info->netdev_kind, "bond")) {
                 r = table_add_many(table,
                                    TABLE_EMPTY,
index 3afe4cf73bcce7ac12c9da716f77c365e7b7aeab..1eff893b21de6126bf824ac50f95b5772640fe88 100644 (file)
@@ -908,13 +908,11 @@ static int dns_query_cname_redirect(DnsQuery *q, const DnsResourceRecord *cname)
         if (r == 0 && k == 0) /* No actual cname happened? */
                 return -ELOOP;
 
-        if (q->answer_protocol == DNS_PROTOCOL_DNS) {
+        if (q->answer_protocol == DNS_PROTOCOL_DNS)
                 /* Don't permit CNAME redirects from unicast DNS to LLMNR or MulticastDNS, so that global resources
                  * cannot invade the local namespace. The opposite way we permit: local names may redirect to global
                  * ones. */
-
                 q->flags &= ~(SD_RESOLVED_LLMNR|SD_RESOLVED_MDNS); /* mask away the local protocols */
-        }
 
         /* Turn off searching for the new name */
         q->flags |= SD_RESOLVED_NO_SEARCH;
index 9ea3de4b17660a14e67c512c2dca0a56fb90d77c..41796243131afac004b4564a0b7b4577ac1aff38 100644 (file)
@@ -538,14 +538,13 @@ static int parse_argv(int argc, char *argv[]) {
                 arg_aggressive_gc = true;
         }
 
-        if (arg_stdio == ARG_STDIO_AUTO) {
+        if (arg_stdio == ARG_STDIO_AUTO)
                 /* If we both --pty and --pipe are specified we'll automatically pick --pty if we are connected fully
                  * to a TTY and pick direct fd passing otherwise. This way, we automatically adapt to usage in a shell
                  * pipeline, but we are neatly interactive with tty-level isolation otherwise. */
                 arg_stdio = isatty(STDIN_FILENO) && isatty(STDOUT_FILENO) && isatty(STDERR_FILENO) ?
                         ARG_STDIO_PTY :
                         ARG_STDIO_DIRECT;
-        }
 
         if (argc > optind) {
                 char **l;
index 305fd8a0f18561d2651a1a555e69859fba9485e7..6bcdfff41a730c33f6b345d662135bf3b98d3ce7 100644 (file)
@@ -473,15 +473,13 @@ int pty_forward_new(
 
         f->master = master;
 
-        if (ioctl(f->output_fd, TIOCGWINSZ, &ws) < 0) {
+        if (ioctl(f->output_fd, TIOCGWINSZ, &ws) < 0)
                 /* If we can't get the resolution from the output fd, then use our internal, regular width/height,
                  * i.e. something derived from $COLUMNS and $LINES if set. */
-
                 ws = (struct winsize) {
                         .ws_row = lines(),
                         .ws_col = columns(),
                 };
-        }
 
         (void) ioctl(master, TIOCSWINSZ, &ws);