From f8b785f10e2d5a2c0abb06413611d3667c7617dd Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 18 Feb 2012 18:13:30 +0000 Subject: [PATCH] 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 --- ChangeLog | 2 + Documentation/NuttxUserGuide.html | 8 ++-- TODO | 16 +------- net/accept.c | 5 ++- net/connect.c | 33 +++++++++++++--- net/net_internal.h | 30 +++++++++----- net/recvfrom.c | 66 +++++++++++++++++-------------- net/sendto.c | 13 +----- 8 files changed, 97 insertions(+), 76 deletions(-) diff --git a/ChangeLog b/ChangeLog index 62e11f6bb64..138ab78b233 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2467,3 +2467,5 @@ a lower-half quadrature encoder driver for the STM32. On initial check-in, this is little more than a "skeleton" file. * Various files: CAN ISO-11783 support contributed by Gary Teravskis. + * net/recv.c and net/recvfrom.c: Correct a bug in return value: The the peer + gracefully closes the connections, needs to return zero and not ENOTCONN \ No newline at end of file diff --git a/Documentation/NuttxUserGuide.html b/Documentation/NuttxUserGuide.html index 78f79b38293..614570aa926 100644 --- a/Documentation/NuttxUserGuide.html +++ b/Documentation/NuttxUserGuide.html @@ -13,7 +13,7 @@

NuttX Operating System

User's Manual

by

Gregory Nutt

-

Last Updated: December 5, 2011

+

Last Updated: February 18, 2011

@@ -7391,8 +7391,7 @@ Those socket APIs are discussed in the following paragraphs.

Returned Values: - see recvfrom(). - Zero on success. + See recvfrom().

2.12.9 recvfrom

@@ -7429,7 +7428,8 @@ Those socket APIs are discussed in the following paragraphs.

Returned Values: On success, returns the number of characters sent. - On error, -1 is returned, and errno is set appropriately: + If no data is available to be received and the peer has performed an orderly shutdown, recv() will return 0. + Othwerwise, on errors, -1 is returned, and errno is set appropriately: