public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] the opened socket is not closed...
@ 2007-10-18  3:53 srinivas naga vutukuri
  0 siblings, 0 replies; only message in thread
From: srinivas naga vutukuri @ 2007-10-18  3:53 UTC (permalink / raw)
  To: ecos-discuss

[-- Attachment #1: Type: text/plain, Size: 541 bytes --]

Hi,

      Am just using the file ping_test.c
under ecos/packages/net/common/current/tests directory...
found that the opened socket is not closed at the end of
ping_test()/ping6_test () functions.

actually the test file is single time runner... probably i thought
using these functions to continously running several times would be
having any problems, like trying to open many sockets or like that....

if so, can adding close(s) at the end of functions would be on safe side...
just attached the patch for it...

best regards,
srinivas.

[-- Attachment #2: ping_test.c.patch --]
[-- Type: application/octet-stream, Size: 677 bytes --]

Index: ping_test.c
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/common/current/tests/ping_test.c,v
retrieving revision 1.6
diff -u -r1.6 ping_test.c
--- ping_test.c	16 Sep 2005 15:15:14 -0000	1.6
+++ ping_test.c	18 Oct 2007 03:33:53 -0000
@@ -362,6 +362,7 @@
     memcpy(&addr,host,sizeof(addr));
     addr.sin6_addr.s6_addr[15] = addr.sin6_addr.s6_addr[15] + 32;
     ping6_host(s, &addr);
+    close(s);	
 }
 #endif
 
@@ -419,6 +420,7 @@
     // Now try a bogus host
     host.sin_addr.s_addr = htonl(ntohl(host.sin_addr.s_addr) + 32);
     ping_host(s, &host);
+    close(s);		
 }
 
 void


[-- Attachment #3: Type: text/plain, Size: 148 bytes --]

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-10-18  3:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-18  3:53 [ECOS] the opened socket is not closed srinivas naga vutukuri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).