minor derivative to reduce compiler warnings and tag read-only parameters as const.

Dependents:   EthernetInterface

Fork of lwip by mbed official

Files at this revision

API Documentation at this revision

Comitter:
WiredHome
Date:
Sun Jun 10 22:17:20 2018 +0000
Parent:
20:52b94de224f0
Commit message:
revise some error returns for unique < 0 numbers

Changed in this revision

api/sockets.c Show annotated file Show diff for this revision Revisions of this file
--- a/api/sockets.c	Tue Jul 07 14:09:21 2015 +0000
+++ b/api/sockets.c	Sun Jun 10 22:17:20 2018 +0000
@@ -414,7 +414,7 @@
   /* check size, familiy and alignment of 'name' */
   LWIP_ERROR("lwip_bind: invalid address", ((namelen == sizeof(struct sockaddr_in)) &&
              ((name->sa_family) == AF_INET) && ((((mem_ptr_t)name) % 4) == 0)),
-             sock_set_errno(sock, err_to_errno(ERR_ARG)); return -1;);
+             sock_set_errno(sock, err_to_errno(ERR_ARG)); return -2;);
   name_in = (const struct sockaddr_in *)(void*)name;
 
   inet_addr_to_ipaddr(&local_addr, &name_in->sin_addr);
@@ -429,7 +429,7 @@
   if (err != ERR_OK) {
     LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_bind(%d) failed, err=%d\n", s, err));
     sock_set_errno(sock, err_to_errno(err));
-    return -1;
+    return -3;
   }
 
   LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_bind(%d) succeeded\n", s));