Commit 4a49f795 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

tcp: print proper error when binding a port fails

parent 08d931d3
......@@ -161,6 +161,7 @@ int *net_Listen (vlc_object_t *p_this, const char *psz_host,
#endif
if (bind (fd, ptr->ai_addr, ptr->ai_addrlen))
{
int err = net_errno;
net_Close (fd);
#if !defined(_WIN32)
fd = rootwrap_bind (ptr->ai_family, ptr->ai_socktype,
......@@ -173,8 +174,7 @@ int *net_Listen (vlc_object_t *p_this, const char *psz_host,
else
#endif
{
msg_Err (p_this, "socket bind error: %s",
vlc_strerror_c(net_errno));
msg_Err (p_this, "socket bind error: %s", vlc_strerror_c(err));
continue;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment