mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-02 12:52:10 +00:00
fixed bug #35928 BSD sockets functions must set errno for POSIX-compliance (patch by Mason)
This commit is contained in:
parent
c82f04f54c
commit
c065427ebe
@ -96,6 +96,10 @@ HISTORY
|
|||||||
|
|
||||||
++ Bugfixes:
|
++ Bugfixes:
|
||||||
|
|
||||||
|
2014-03-11: Simon Goldschmidt (patch by Mason)
|
||||||
|
* opt.h, sockets.c: fixed bug #35928 BSD sockets functions must set errno for
|
||||||
|
POSIX-compliance
|
||||||
|
|
||||||
2014-02-27: Simon Goldschmidt
|
2014-02-27: Simon Goldschmidt
|
||||||
* dhcp.c: fixed bug #40303 DHCP xid renewed when sending a DHCPREQUEST
|
* dhcp.c: fixed bug #40303 DHCP xid renewed when sending a DHCPREQUEST
|
||||||
|
|
||||||
|
@ -223,13 +223,13 @@ static const int err_to_errno_table[] = {
|
|||||||
((unsigned)(-(err)) < ERR_TO_ERRNO_TABLE_SIZE ? \
|
((unsigned)(-(err)) < ERR_TO_ERRNO_TABLE_SIZE ? \
|
||||||
err_to_errno_table[-(err)] : EIO)
|
err_to_errno_table[-(err)] : EIO)
|
||||||
|
|
||||||
#ifdef ERRNO
|
#if LWIP_SOCKET_SET_ERRNO
|
||||||
#ifndef set_errno
|
#ifndef set_errno
|
||||||
#define set_errno(err) do { if (err) { errno = (err); } } while(0)
|
#define set_errno(err) do { if (err) { errno = (err); } } while(0)
|
||||||
#endif
|
#endif
|
||||||
#else /* ERRNO */
|
#else /* LWIP_SOCKET_SET_ERRNO */
|
||||||
#define set_errno(err)
|
#define set_errno(err)
|
||||||
#endif /* ERRNO */
|
#endif /* LWIP_SOCKET_SET_ERRNO */
|
||||||
|
|
||||||
#define sock_set_errno(sk, e) do { \
|
#define sock_set_errno(sk, e) do { \
|
||||||
sk->err = (e); \
|
sk->err = (e); \
|
||||||
|
@ -1493,6 +1493,13 @@
|
|||||||
#define LWIP_SOCKET 1
|
#define LWIP_SOCKET 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* LWIP_SOCKET_SET_ERRNO==1: Set errno when socket functions cannot complete
|
||||||
|
* successfully, as required by POSIX. Default is POSIX-compliant.
|
||||||
|
*/
|
||||||
|
#ifndef LWIP_SOCKET_SET_ERRNO
|
||||||
|
#define LWIP_SOCKET_SET_ERRNO 1
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names.
|
* LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names.
|
||||||
* (only used if you use sockets.c)
|
* (only used if you use sockets.c)
|
||||||
|
Loading…
Reference in New Issue
Block a user