summaryrefslogtreecommitdiff
path: root/nuttx/net/local/local_sendto.c
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-01-30 09:28:55 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-01-30 09:28:55 -0600
commit3fa110d8bca649c3ffce76fde4314455a433af8a (patch)
tree8ed57cd2228687df60d525e88f5788c15e2bb880 /nuttx/net/local/local_sendto.c
parent85613e95e429679cd5bcff6af94e794fa1636b92 (diff)
downloadpx4-nuttx-3fa110d8bca649c3ffce76fde4314455a433af8a.tar.gz
px4-nuttx-3fa110d8bca649c3ffce76fde4314455a433af8a.tar.bz2
px4-nuttx-3fa110d8bca649c3ffce76fde4314455a433af8a.zip
Unix domain: Add logic to release references to the half duplex FIFO after sendto and recvfrom
Diffstat (limited to 'nuttx/net/local/local_sendto.c')
-rw-r--r--nuttx/net/local/local_sendto.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/nuttx/net/local/local_sendto.c b/nuttx/net/local/local_sendto.c
index 9c242c87a..449441759 100644
--- a/nuttx/net/local/local_sendto.c
+++ b/nuttx/net/local/local_sendto.c
@@ -141,7 +141,9 @@ ssize_t psock_local_sendto(FAR struct socket *psock, FAR const void *buf,
{
ndbg("ERROR: Failed to open FIFO for %s: %d\n",
unaddr->sun_path, ret);
- return ret;
+
+ nsent = ret;
+ goto errout_with_halfduplex;
}
/* Send the packet */
@@ -163,6 +165,10 @@ ssize_t psock_local_sendto(FAR struct socket *psock, FAR const void *buf,
close(conn->lc_outfd);
conn->lc_outfd = -1;
+errout_with_halfduplex:
+ /* Release our reference to the half duplex FIFO*/
+
+ (void)local_release_halfduplex(conn);
return nsent;
}