fixed bug #35928 BSD sockets functions must set errno for POSIX-compliance (patch by Mason)

This commit is contained in:
Simon Goldschmidt
2014-03-11 20:53:44 +01:00
parent c82f04f54c
commit c065427ebe
3 changed files with 14 additions and 3 deletions

View File

@@ -223,13 +223,13 @@ static const int err_to_errno_table[] = {
((unsigned)(-(err)) < ERR_TO_ERRNO_TABLE_SIZE ? \
err_to_errno_table[-(err)] : EIO)
#ifdef ERRNO
#if LWIP_SOCKET_SET_ERRNO
#ifndef set_errno
#define set_errno(err) do { if (err) { errno = (err); } } while(0)
#endif
#else /* ERRNO */
#else /* LWIP_SOCKET_SET_ERRNO */
#define set_errno(err)
#endif /* ERRNO */
#endif /* LWIP_SOCKET_SET_ERRNO */
#define sock_set_errno(sk, e) do { \
sk->err = (e); \