Add errno support to if_indextoname()

This commit adds support in if_indextoname() to return ENXIO when
no interface is found.  This conforms to the Open Group/RFC 3493
specification

In order to leverage errno set support, the set_errno macro from
sockets.c was moved to sockets_priv.h
This commit is contained in:
Joel Cunningham
2017-02-09 22:32:29 -06:00
parent 852993029d
commit 3a7e03aaff
3 changed files with 16 additions and 16 deletions

View File

@@ -293,14 +293,6 @@ static struct lwip_select_cb *select_cb_list;
and checked in event_callback to see if it has changed. */
static volatile int select_cb_ctr;
#if LWIP_SOCKET_SET_ERRNO
#ifndef set_errno
#define set_errno(err) do { if (err) { errno = (err); } } while(0)
#endif
#else /* LWIP_SOCKET_SET_ERRNO */
#define set_errno(err)
#endif /* LWIP_SOCKET_SET_ERRNO */
#define sock_set_errno(sk, e) do { \
const int sockerr = (e); \
sk->err = (u8_t)sockerr; \