Skip to content

Commit

Permalink
Fix some formatting related to if/else and macros
Browse files Browse the repository at this point in the history
Make it clearer where the blocks are.

Change-Id: If645c3faf149bac82167a91be13541b30a1b8d6a
Signed-off-by: Frank Lichtenheld <[email protected]>
Acked-by: Lev Stipakov <[email protected]>
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg30027.html
Signed-off-by: Gert Doering <[email protected]>
  • Loading branch information
flichtenheld authored and cron2 committed Dec 6, 2024
1 parent 7da1492 commit 91b6e28
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/openvpn/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ helper_client_server(struct options *o)
push_option(o, print_opt_route_gateway_dhcp(&o->gc), M_USAGE);
}
}
else

/*
* HELPER DIRECTIVE:
*
Expand All @@ -511,7 +511,7 @@ helper_client_server(struct options *o)
* pull
* tls-client
*/
if (o->client)
else if (o->client)
{
o->pull = true;
o->tls_client = true;
Expand Down
12 changes: 8 additions & 4 deletions src/openvpn/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -1822,7 +1822,9 @@ man_accept(struct management *man)
}
else
#endif
man->connection.sd_cli = socket_do_accept(man->connection.sd_top, &act, false);
{
man->connection.sd_cli = socket_do_accept(man->connection.sd_top, &act, false);
}

if (socket_defined(man->connection.sd_cli))
{
Expand Down Expand Up @@ -1971,9 +1973,11 @@ man_connect(struct management *man)
}
else
#endif
msg(D_LINK_ERRORS | M_ERRNO,
"MANAGEMENT: connect to %s failed",
print_sockaddr(man->settings.local->ai_addr, &gc));
{
msg(D_LINK_ERRORS | M_ERRNO,
"MANAGEMENT: connect to %s failed",
print_sockaddr(man->settings.local->ai_addr, &gc));
}
throw_signal_soft(SIGTERM, "management-connect-failed");
goto done;
}
Expand Down
6 changes: 3 additions & 3 deletions src/openvpn/openvpn.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,10 @@ openvpn_main(int argc, char *argv[])

/* Query passwords before becoming a daemon if we don't use the
* management interface to get them. */
#ifdef ENABLE_MANAGEMENT
if (!(c.options.management_flags & MF_QUERY_PASSWORDS))
#endif
init_query_passwords(&c);
{
init_query_passwords(&c);
}

/* become a daemon if --daemon */
if (c.first_time)
Expand Down
5 changes: 3 additions & 2 deletions src/openvpn/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -3914,8 +3914,9 @@ get_default_gateway_ipv6(struct route_ipv6_gateway_info *rgi6,
}
else
#endif

rgi6->gateway.addr_ipv6 = gw;
{
rgi6->gateway.addr_ipv6 = gw;
}
rgi6->flags |= RGI_ADDR_DEFINED;

if (ifp)
Expand Down
6 changes: 4 additions & 2 deletions src/openvpn/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -3389,8 +3389,10 @@ link_socket_read_udp_posix(struct link_socket *sock,
}
else
#endif
buf->len = recvfrom(sock->sd, BPTR(buf), buf_forward_capacity(buf), 0,
&from->dest.addr.sa, &fromlen);
{
buf->len = recvfrom(sock->sd, BPTR(buf), buf_forward_capacity(buf), 0,
&from->dest.addr.sa, &fromlen);
}
/* FIXME: won't do anything when sock->info.af == AF_UNSPEC */
if (buf->len >= 0 && expectedlen && fromlen != expectedlen)
{
Expand Down
4 changes: 3 additions & 1 deletion src/openvpn/ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,9 @@ auth_user_pass_setup(const char *auth_file, bool is_inline,
}
else
#endif /* ifdef ENABLE_MANAGEMENT */
get_user_pass(&auth_user_pass, auth_file, UP_TYPE_AUTH, flags);
{
get_user_pass(&auth_user_pass, auth_file, UP_TYPE_AUTH, flags);
}
}
}

Expand Down

0 comments on commit 91b6e28

Please sign in to comment.