Skip to content

Commit 1ac5700

Browse files
author
Hasnain Virk
committed
[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
1 parent 1f24533 commit 1ac5700

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

features/nanostack/FEATURE_NANOSTACK/nanostack-interface/NanostackInterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ nsapi_size_or_error_t NanostackInterface::do_sendto(void *handle, const ns_addre
569569
* \return -5 Socket not connected
570570
* \return -6 Packet too short (ICMP raw socket error).
571571
* */
572-
if (retcode == -2 || retcode == NS_EWOULDBLOCK) {
572+
if (retcode == NS_EWOULDBLOCK) {
573573
ret = NSAPI_ERROR_WOULD_BLOCK;
574574
} else if (retcode < 0) {
575575
tr_error("socket_sendmsg: error=%d", retcode);

0 commit comments

Comments
 (0)