Commit 357771f9 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Print Winsock error instead of errno if applicable

parent 9ecfcfc9
...@@ -318,7 +318,18 @@ static void QueueMsg( vlc_object_t *p_this, int i_queue, int i_type, ...@@ -318,7 +318,18 @@ static void QueueMsg( vlc_object_t *p_this, int i_queue, int i_type,
char errbuf[2001]; char errbuf[2001];
size_t errlen; size_t errlen;
#ifndef WIN32
strerror_r( errno, errbuf, 1001 ); strerror_r( errno, errbuf, 1001 );
#else
int sockerr = WSAGetLastError( );
if( sockerr )
{
strncpy( errbuf, net_strerror( sockerr ), 1001 );
WSASetLastError( sockerr );
}
else
strncpy( errbuf, strerror( errno ), 1001 );
#endif
errbuf[1000] = 0; errbuf[1000] = 0;
/* Escape '%' from the error string */ /* Escape '%' from the error string */
......
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