Browse Source

MT#55283 use bool type

Change-Id: I75aa1a4091ecc91d4937dfc0bdceb18551a9c879
pull/1910/head
Richard Fuchs 10 months ago
parent
commit
b9972e481e
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      daemon/media_socket.c

+ 4
- 4
daemon/media_socket.c View File

@ -941,17 +941,17 @@ struct local_intf *get_any_interface_address(const struct logical_intf *lif, soc
* Opens a socket for a given port value and edits the iptables accordingly.
* It doesn't provide a port selection logic.
*/
static int add_socket(socket_t *r, unsigned int port, struct intf_spec *spec, const str *label) {
static bool add_socket(socket_t *r, unsigned int port, struct intf_spec *spec, const str *label) {
__C_DBG("An attempt to open a socket for the port: '%u'", port);
if (open_socket(r, SOCK_DGRAM, port, &spec->local_address.addr)) {
__C_DBG("Can't open a socket for the port: '%d'", port);
return -1;
return false;
}
iptables_add_rule(r, label);
socket_timestamping(r);
__C_DBG("A socket is successfully bound for the port: '%u'", port);
return 0;
return true;
}
/**
* Pushing ports into the `ports_to_release` queue.
@ -1203,7 +1203,7 @@ new_cycle:
t_queue_push_tail(out, sk);
/* if not possible to engage this socket, try to reallocate it again */
if (add_socket(sk, port, spec, label)) {
if (!add_socket(sk, port, spec, label)) {
/* if something has been left in the `ports_to_engage` queue, release it right away */
while ((port = GPOINTER_TO_UINT(g_queue_pop_head(&ports_to_engage))))
{


Loading…
Cancel
Save