From fadbb925a6a118790d8d661fea3956bb0f76348a Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 18 Feb 2012 18:13:30 +0000 Subject: 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 --- apps/netutils/tftpc/tftpc_put.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'apps/netutils/tftpc/tftpc_put.c') diff --git a/apps/netutils/tftpc/tftpc_put.c b/apps/netutils/tftpc/tftpc_put.c index c292244a6..b36599718 100644 --- a/apps/netutils/tftpc/tftpc_put.c +++ b/apps/netutils/tftpc/tftpc_put.c @@ -217,9 +217,17 @@ static int tftp_rcvack(int sd, uint8_t *packet, struct sockaddr_in *server, { /* Failed to receive a good packet */ - if (nbytes >= 0) + if (nbytes == 0) { - ndbg("tftp_recvfrom short packet: %d bytes\n", nbytes); + ndbg("Connection lost: %d bytes\n", nbytes); + } + else if (nbytes > 0) + { + ndbg("Short packet: %d bytes\n", nbytes); + } + else + { + ndbg("Recveid failure\n"); } /* Break out to bump up the retry count */ -- cgit v1.2.3