From dcf825f3b1272edaea8977c82358d58fac0cb35c Mon Sep 17 00:00:00 2001 From: lottaviano Date: Mon, 28 Mar 2011 12:18:41 +0000 Subject: [PATCH] Correctly set errno when sockets API is enabled. The sockets.c provides BSD compatible sockets API, which uses errno to communicate which error occurred. Without setting ERRNO, it's not possible to find out which error occurred, eg. it's not possible to understand if the peer reset the connection after a call to send(). git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4817 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/cfg/cfg_lwip.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bertos/cfg/cfg_lwip.h b/bertos/cfg/cfg_lwip.h index b6b55f65..73acb913 100644 --- a/bertos/cfg/cfg_lwip.h +++ b/bertos/cfg/cfg_lwip.h @@ -1206,6 +1206,13 @@ * $WIZ$ type = "boolean" */ #define LWIP_SOCKET 1 +#if LWIP_SOCKET + /* + * The sockets.c file requires this macro to be defined to really + * set errno on errors. + */ + #define ERRNO +#endif /** * Enable BSD-style sockets functions names. -- 2.25.1