Fix function signature of fcntl() for LWIP_COMPAT_SOCKETS == 2 && LWIP_POSIX_SOCKETS_IO_NAMES (see bug #51701)

This commit is contained in:
goldsimon 2017-08-25 22:07:14 +02:00
parent c7edfdf987
commit e749678eed
2 changed files with 19 additions and 1 deletions

View File

@ -66,6 +66,10 @@
#include "lwip/inet_chksum.h"
#endif
#if LWIP_COMPAT_SOCKETS == 2 && LWIP_POSIX_SOCKETS_IO_NAMES
#include <stdarg.h>
#endif
#include <string.h>
/* If the netconn API is not required publicly, then we include the necessary
@ -3467,6 +3471,20 @@ lwip_fcntl(int s, int cmd, int val)
return ret;
}
#if LWIP_COMPAT_SOCKETS == 2 && LWIP_POSIX_SOCKETS_IO_NAMES
int
fcntl(int s, int cmd, ...)
{
va_list ap;
int val;
va_start(ap, cmd);
val = va_arg(ap, int);
va_end(ap);
return lwip_fcntl(s, cmd, val);
}
#endif
const char *
lwip_inet_ntop(int af, const void *src, char *dst, socklen_t size)
{

View File

@ -534,7 +534,7 @@ void lwip_socket_thread_cleanup(void); /* LWIP_NETCONN_SEM_PER_THREAD==1: destro
#undef lwip_close
#define lwip_close close
#define closesocket(s) close(s)
#define lwip_fcntl fcntl
int fcntl(int s, int cmd, ...);
#define lwip_ioctl ioctl
#endif /* LWIP_POSIX_SOCKETS_IO_NAMES */
#endif /* LWIP_COMPAT_SOCKETS == 2 */