(netplay.c) Use socket_bind

This commit is contained in:
twinaphex 2016-05-01 22:59:35 +02:00
parent 004d9a613c
commit f4762f6f33
2 changed files with 2 additions and 5 deletions

View File

@ -136,7 +136,7 @@ static bool cmd_init_network(rarch_cmd_t *handle, uint16_t port)
if (!socket_nonblock(handle->net_fd))
goto error;
if (!socket_bind(handle->net_fd, res))
if (!socket_bind(handle->net_fd, (void*)res))
{
RARCH_ERR("Failed to bind socket.\n");
goto error;

View File

@ -667,10 +667,7 @@ static int init_tcp_connection(const struct addrinfo *res,
}
else
{
int yes = 1;
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (const char*)&yes, sizeof(int));
if (bind(fd, res->ai_addr, res->ai_addrlen) < 0 ||
if ( !socket_bind(fd, (void*)res) ||
listen(fd, spectate ? MAX_SPECTATORS : 1) < 0)
{
ret = false;