[ONME-2953 ]Minor glitch in error handling

In sendto(), memory allocation failures were mistakenly being treated as
would blocks (assumption was that the device might be able to recover).
However, that put the blocking socket into deep sleep and there was no mechanism to wake it up
ever again. Somehow that got slipped through testing. Fixed in this amenment
pull/3517/head
Hasnain Virk 2017-02-13 16:37:12 +02:00
parent 1f24533847
commit 1ac5700eb6
1 changed files with 1 additions and 1 deletions

View File

@ -569,7 +569,7 @@ nsapi_size_or_error_t NanostackInterface::do_sendto(void *handle, const ns_addre
* \return -5 Socket not connected
* \return -6 Packet too short (ICMP raw socket error).
* */
if (retcode == -2 || retcode == NS_EWOULDBLOCK) {
if (retcode == NS_EWOULDBLOCK) {
ret = NSAPI_ERROR_WOULD_BLOCK;
} else if (retcode < 0) {
tr_error("socket_sendmsg: error=%d", retcode);