Skip to content

Commit

Permalink
fix local_sendmsg return length
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Bee <[email protected]>
  • Loading branch information
PeterBee97 authored and xiaoxiang781216 committed Mar 12, 2021
1 parent d28962b commit 6f995e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
9 changes: 0 additions & 9 deletions net/local/local_sendmsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,6 @@ static ssize_t local_send(FAR struct socket *psock,
/* Send the packet */

ret = local_send_packet(&peer->lc_outfile, buf, len);

/* If the send was successful, then the full packet will have been
* sent
*/

if (ret >= 0)
{
ret = len;
}
}
break;
#endif /* CONFIG_NET_LOCAL_STREAM */
Expand Down
8 changes: 4 additions & 4 deletions net/local/local_sendpacket.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ static int local_fifo_write(FAR struct file *filep, FAR const uint8_t *buf,
* len Length of data to send
*
* Returned Value:
* Zero is returned on success; a negated errno value is returned on any
* failure.
* Packet length is returned on success; a negated errno value is returned
* on any failure.
*
****************************************************************************/

Expand Down Expand Up @@ -158,10 +158,10 @@ int local_send_packet(FAR struct file *filep, FAR const struct iovec *buf,
if (ret < 0)
break;
else
len16 += ret;
len16 += iov->iov_len;
}

if (ret > 0)
if (ret == OK)
ret = len16;
}
}
Expand Down

0 comments on commit 6f995e3

Please sign in to comment.