diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-02-18 18:13:30 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-02-18 18:13:30 +0000 |
commit | fadbb925a6a118790d8d661fea3956bb0f76348a (patch) | |
tree | ca4c58d32d12949e8d08cb69a652b5e3f7fd0e58 /nuttx/net/sendto.c | |
parent | 376af5201c555ee163045a8103d8e592f9a1b1bc (diff) | |
download | px4-nuttx-fadbb925a6a118790d8d661fea3956bb0f76348a.tar.gz px4-nuttx-fadbb925a6a118790d8d661fea3956bb0f76348a.tar.bz2 px4-nuttx-fadbb925a6a118790d8d661fea3956bb0f76348a.zip |
Correct and error in recv() and recvfrom() return value
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4402 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/net/sendto.c')
-rw-r--r-- | nuttx/net/sendto.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/nuttx/net/sendto.c b/nuttx/net/sendto.c index 4e1f9015f..cd3026eac 100644 --- a/nuttx/net/sendto.c +++ b/nuttx/net/sendto.c @@ -103,22 +103,13 @@ static uint16_t sendto_interrupt(struct uip_driver_s *dev, void *conn, nllvdbg("flags: %04x\n", flags); if (pstate) { - /* Check if the connection was rejected */ - - if ((flags & (UIP_CLOSE|UIP_ABORT|UIP_TIMEDOUT)) != 0) - { - /* Yes.. then terminate with an error */ - - pstate->st_sndlen = -ENOTCONN; - } - /* Check if the outgoing packet is available (it may have been claimed * by a sendto interrupt serving a different thread -OR- if the output * buffer currently contains unprocessed incoming data. In these cases * we will just have to wait for the next polling cycle. */ - else if (dev->d_sndlen > 0 || (flags & UIP_NEWDATA) != 0) + if (dev->d_sndlen > 0 || (flags & UIP_NEWDATA) != 0) { /* Another thread has beat us sending data or the buffer is busy, * wait for the next polling cycle @@ -314,7 +305,7 @@ ssize_t psock_sendto(FAR struct socket *psock, FAR const void *buf, state.st_cb = uip_udpcallbackalloc(conn); if (state.st_cb) { - state.st_cb->flags = UIP_POLL|UIP_CLOSE|UIP_ABORT|UIP_TIMEDOUT; + state.st_cb->flags = UIP_POLL; state.st_cb->priv = (void*)&state; state.st_cb->event = sendto_interrupt; |