From f296c582a54480395ea6a420673b6689d282e17f Mon Sep 17 00:00:00 2001 From: aozima Date: Sat, 14 Jun 2014 21:49:46 +0800 Subject: [PATCH] fixed bug: close socket when ping() exit. --- components/net/lwip-1.3.2/apps/ping.c | 2 ++ components/net/lwip/apps/ping.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/components/net/lwip-1.3.2/apps/ping.c b/components/net/lwip-1.3.2/apps/ping.c index d3c3dd399b..1360c932fa 100644 --- a/components/net/lwip-1.3.2/apps/ping.c +++ b/components/net/lwip-1.3.2/apps/ping.c @@ -166,6 +166,8 @@ rt_err_t ping(char* target, rt_uint32_t time, rt_size_t size) rt_thread_delay(PING_DELAY); /* take a delay */ } + + lwip_close(s); return RT_EOK; } diff --git a/components/net/lwip/apps/ping.c b/components/net/lwip/apps/ping.c index d3c3dd399b..1360c932fa 100644 --- a/components/net/lwip/apps/ping.c +++ b/components/net/lwip/apps/ping.c @@ -166,6 +166,8 @@ rt_err_t ping(char* target, rt_uint32_t time, rt_size_t size) rt_thread_delay(PING_DELAY); /* take a delay */ } + + lwip_close(s); return RT_EOK; }