[EXTERNAL] Re: [PATCH 2/5] Cygwin: resolver: Process options forward (not backwards)

Corinna Vinschen corinna-cygwin@cygwin.com
Tue Jan 18 15:22:14 GMT 2022


On Jan 18 13:58, Lavrentiev, Anton (NIH/NLM/NCBI) [C] via Cygwin-patches wrote:
> > I pushed patches 1 and 3 to 5.  I fixed the consitency typo
> > throughout.
> 
> Thanks!  (and oops :-)
> 
> > Right now, the debug flag gets set in several places throughout the
> > code.  Given you set the debug flag above, doesn't that mean several
> > code snippets setting the debug flag later in the code can go away?
> 
> No, they can't.  The flag can be propagated from "res_init()" from the user
> land.  When /etc/resolv.conf gets loaded, its "options" can also specify the
> debug setting (so it should become active since then), but formerly the code was
> using only the init-provided value in "get_resolv()" yet the debug setting from
> "options" (parsed by "get_options()") only affected the options themselves,
> but not the calling code in "get_resolv()", which kept on using the initial value.
> That made the remainder of the file parse to continue "silent" unless "res_init()"
> was previously called with RES_DEBUG.
> 
> So that was, again, inconsistent! (see, I can spell it this time around :-)
> 
> Post-"get_options()" assignment is not an additional assignment, it's a refresh
> of a possibly changed value (for a local "debug" variable).  I think the patch is correct,
> and it works, for what I am concerned, -- I checked that and was using it.

Thanks for the description.  Would you mind to recreate your patch with
a matching commit message text explaining the debug flag setting?


Thanks,
Corinna


More information about the Cygwin-patches mailing list