MT#55283 convert open_v46_socket to bool

Change-Id: I174a08cbed3f6ac856bf29458ee3c81ca2947de9
pull/1910/head
Richard Fuchs 10 months ago
parent c2ba54e615
commit 386f1d50cd

@ -77,7 +77,7 @@ const char *dtmf_trigger_types[__NUM_DTMF_TRIGGERS] = {
bool dtmf_init(void) {
ilog(LOG_DEBUG, "log dtmf over ng %d", rtpe_config.dtmf_via_ng);
ilog(LOG_DEBUG, "no log injected dtmf %d", rtpe_config.dtmf_no_log_injects);
if (open_v46_socket(&dtmf_log_sock, SOCK_DGRAM)) {
if (!open_v46_socket(&dtmf_log_sock, SOCK_DGRAM)) {
ilog(LOG_ERR, "Failed to open/connect DTMF logging socket: %s", strerror(errno));
return false;
}

@ -772,14 +772,14 @@ fail:
return false;
}
int open_v46_socket(socket_t *r, int type) {
bool open_v46_socket(socket_t *r, int type) {
int ret = __socket(r, type, &__socket_families[SF_IP6]);
if (ret) {
if (errno == EAFNOSUPPORT)
ret = __socket(r, type, &__socket_families[SF_IP4]);
if (ret) {
__C_DBG("open socket fail");
return -1;
return false;
}
}
else
@ -787,7 +787,7 @@ int open_v46_socket(socket_t *r, int type) {
nonblock(r->fd);
return 0;
return true;
}
void dummy_socket(socket_t *r, const sockaddr_t *sa) {

@ -275,7 +275,7 @@ INLINE int socket_cpu_affinity(socket_t *s, int cpu) {
void socket_init(void);
bool open_socket(socket_t *r, int type, unsigned int port, const sockaddr_t *);
int open_v46_socket(socket_t *r, int type);
bool open_v46_socket(socket_t *r, int type);
int connect_socket(socket_t *r, int type, const endpoint_t *ep);
int connect_socket_nb(socket_t *r, int type, const endpoint_t *ep); // 1 == in progress
int connect_socket_retry(socket_t *r); // retries connect() while in progress

Loading…
Cancel
Save