#include <errno.h>
#include <assert.h>
-
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
#ifdef HAVE_POLL
# include <poll.h>
#endif
ptr->ai_socktype, ptr->ai_protocol );
if( fd == -1 )
{
- msg_Dbg( p_this, "socket error: %m" );
+ msg_Dbg( p_this, "socket error: %s", vlc_strerror_c(net_errno) );
continue;
}
if( net_errno != EINPROGRESS && net_errno != EINTR )
{
- msg_Err( p_this, "connection failed: %m" );
+ msg_Err( p_this, "connection failed: %s",
+ vlc_strerror_c(net_errno) );
goto next_ai;
}
switch (val)
{
case -1: /* error */
- msg_Err (p_this, "connection polling error: %m");
+ msg_Err (p_this, "polling error: %s",
+ vlc_strerror_c(net_errno));
goto next_ai;
case 0: /* timeout */
if (getsockopt (fd, SOL_SOCKET, SO_ERROR, &val,
&(socklen_t){ sizeof (val) }) || val)
{
- errno = val;
- msg_Err (p_this, "connection failed: %m");
+ msg_Err (p_this, "connection failed: %s",
+ vlc_strerror_c(val));
goto next_ai;
}
}
if (fd == -1)
{
if (net_errno != EAGAIN && net_errno != EWOULDBLOCK)
- msg_Err (obj, "accept failed (from socket %d): %m", lfd);
+ msg_Err (obj, "accept failed (from socket %d): %s", lfd,
+ vlc_strerror_c(net_errno));
return -1;
}
{
if (net_errno != EINTR)
{
- msg_Err (p_this, "poll error: %m");
+ msg_Err (p_this, "poll error: %s", vlc_strerror_c(net_errno));
return -1;
}
}