public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "srinivas naga vutukuri" <srinivas.vutukuri@gmail.com>
To: ecos-discuss@ecos.sourceware.org
Subject: [ECOS] the opened socket is not closed...
Date: Thu, 18 Oct 2007 03:53:00 -0000	[thread overview]
Message-ID: <ace3f33d0710172053w28985628p43fac7fd3fd826ef@mail.gmail.com> (raw)

[-- 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

                 reply	other threads:[~2007-10-18  3:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ace3f33d0710172053w28985628p43fac7fd3fd826ef@mail.gmail.com \
    --to=srinivas.vutukuri@gmail.com \
    --cc=ecos-discuss@ecos.sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).