posix: sockets: Fix return value of recvfrom and sendto
_bind_connect already sets errno and returns -1 or 0. Signed-off-by: Francois Berder <francois.berder@imgtec.com>
This commit is contained in:
parent
8d2ec19be6
commit
27dec749e8
@ -786,8 +786,7 @@ ssize_t recvfrom(int socket, void *restrict buffer, size_t length, int flags,
|
||||
#endif
|
||||
/* bind implicitly */
|
||||
if ((res = _bind_connect(s, NULL, 0)) < 0) {
|
||||
errno = -res;
|
||||
return -1;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
switch (s->type) {
|
||||
@ -873,8 +872,7 @@ ssize_t sendto(int socket, const void *buffer, size_t length, int flags,
|
||||
#endif
|
||||
/* bind implicitly */
|
||||
if ((res = _bind_connect(s, NULL, 0)) < 0) {
|
||||
errno = -res;
|
||||
return -1;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
#if defined(MODULE_SOCK_IP) || defined(MODULE_SOCK_UDP)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user