This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
Re: Do not relaunch tftpd server upon second invocation of profile_on
- From: Andrew Lunn <andrew at lunn dot ch>
- To: ?yvind Harboe <oyvind dot harboe at zylin dot com>
- Cc: eCos Disuss <ecos-patches at ecos dot sourceware dot org>
- Date: Wed, 29 Oct 2008 21:42:15 +0100
- Subject: Re: Do not relaunch tftpd server upon second invocation of profile_on
- References: <c09652430810140440p1b13ccf5qe211a4566462c1ab@mail.gmail.com>
>
> -#ifdef CYGPKG_PROFILE_TFTP
> - // Create a TFTP server to provide the data
> - // invoking this a second time is harmless
> - (void) tftpd_start(CYGNUM_PROFILE_TFTP_PORT, &profile_tftp_fileops);
> +#ifdef CYGPKG_PROFILE_TFTP
> + static int launched = 0;
> + if (!launched)
> + {
> + launched = 1;
> + // Create a TFTP server to provide the data
> + // invoking this a second time is harmless
> + (void) tftpd_start(CYGNUM_PROFILE_TFTP_PORT, &profile_tftp_fileops);
> + }
> #endif
> }
What seems strange here is that the comment says it is harmless to
invoke it a second time. Yet your launched flag seems to stop it being
launched a second time. And your patch keeps that comment.
Is the comment wrong? If so why did you keep it?
Like i said, i wanted to dig in deeper and understand the problem and
then the patch. Maybe you can provide an explanation?
Andrew