[vlc-commits] tcp: print proper error when binding a port fails
Rémi Denis-Courmont
git at videolan.org
Sat Sep 16 15:15:22 CEST 2017
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Sep 16 16:14:49 2017 +0300| [4a49f795c1e28b21ae2e542de5349c05fbc9cd21] | committer: Rémi Denis-Courmont
tcp: print proper error when binding a port fails
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4a49f795c1e28b21ae2e542de5349c05fbc9cd21
---
src/network/io.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/network/io.c b/src/network/io.c
index 20a01adb89..0e6bc1be2c 100644
--- a/src/network/io.c
+++ b/src/network/io.c
@@ -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;
}
}
More information about the vlc-commits
mailing list