summaryrefslogtreecommitdiff
path: root/nuttx/net/sendto.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-11-22 21:59:30 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-11-22 21:59:30 +0000
commit797f58d1f0e2265f7c3c054eb1b8f7bfe4fcecfc (patch)
tree33a2e7ffc7cceb40d26fbb7f6aed9a34c62f8d7e /nuttx/net/sendto.c
parent1376a1a626cc3bd88e82d698d4e6f3a236f81b37 (diff)
downloadnuttx-797f58d1f0e2265f7c3c054eb1b8f7bfe4fcecfc.tar.gz
nuttx-797f58d1f0e2265f7c3c054eb1b8f7bfe4fcecfc.tar.bz2
nuttx-797f58d1f0e2265f7c3c054eb1b8f7bfe4fcecfc.zip
Added UDP test/example
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@400 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/net/sendto.c')
-rw-r--r--nuttx/net/sendto.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/nuttx/net/sendto.c b/nuttx/net/sendto.c
index bbcf65b80..e6f267a69 100644
--- a/nuttx/net/sendto.c
+++ b/nuttx/net/sendto.c
@@ -208,11 +208,18 @@ ssize_t sendto(int sockfd, const void *buf, size_t len, int flags,
int err;
int ret;
- /* If to is NULL or tolen is zero, then this function is same as send */
+ /* If to is NULL or tolen is zero, then this function is same as send (for
+ * connected socket types)
+ */
if (!to || !tolen)
{
+#ifdef CONFIG_NET_TCP
return send(sockfd, buf, len, flags);
+#else
+ err = EINVAL;
+ goto errout;
+#endif
}
/* Verify that a valid address has been provided */