This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Do not relaunch tftpd server upon second invocation of profile_on


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]