From: lottaviano Date: Mon, 28 Mar 2011 12:18:41 +0000 (+0000) Subject: Correctly set errno when sockets API is enabled. X-Git-Tag: 2.7.0~149 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=dcf825f3b1272edaea8977c82358d58fac0cb35c;p=bertos.git 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 --- 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.