Correctly set errno when sockets API is enabled.
authorlottaviano <lottaviano@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 28 Mar 2011 12:18:41 +0000 (12:18 +0000)
committerlottaviano <lottaviano@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 28 Mar 2011 12:18:41 +0000 (12:18 +0000)
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

index b6b55f65269d3df5bcc07c6073240abbb54a1d7c..73acb913534f4b4c33be90e72e0a8d99ea43e2db 100644 (file)
  * $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.