* RE: [PATCH 2/5] Cygwin: resolver: Process options forward (not backwards)
@ 2022-01-18 16:10 Lavrentiev, Anton (NIH/NLM/NCBI) [C]
0 siblings, 0 replies; 3+ messages in thread
From: Lavrentiev, Anton (NIH/NLM/NCBI) [C] @ 2022-01-18 16:10 UTC (permalink / raw)
To: cygwin-patches
> Thanks for the description. Would you mind to recreate your patch with
> a matching commit message text explaining the debug flag setting?
Okay, just did.
Anton Lavrentiev
Contractor NIH/NLM/NCBI
^ permalink raw reply [flat|nested] 3+ messages in thread
* (no subject) @ 2022-01-17 18:03 Anton Lavrentiev 2022-01-17 18:03 ` [PATCH 2/5] Cygwin: resolver: Process options forward (not backwards) Anton Lavrentiev 0 siblings, 1 reply; 3+ messages in thread From: Anton Lavrentiev @ 2022-01-17 18:03 UTC (permalink / raw) To: cygwin-patches Resubmitting the patches with the requested commit message changes ^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 2/5] Cygwin: resolver: Process options forward (not backwards) 2022-01-17 18:03 Anton Lavrentiev @ 2022-01-17 18:03 ` Anton Lavrentiev 2022-01-18 10:32 ` Corinna Vinschen 0 siblings, 1 reply; 3+ messages in thread From: Anton Lavrentiev @ 2022-01-17 18:03 UTC (permalink / raw) To: cygwin-patches --- winsup/cygwin/libc/minires.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/winsup/cygwin/libc/minires.c b/winsup/cygwin/libc/minires.c index 0cf9efd9b..fdc6087f5 100644 --- a/winsup/cygwin/libc/minires.c +++ b/winsup/cygwin/libc/minires.c @@ -86,12 +86,12 @@ Read options ***********************************************************************/ -static void get_options(res_state statp, int i, char **words) +static void get_options(res_state statp, int n, char **words) { char *ptr; - int value; + int i, value; - while (i-- > 0) { + for (i = 0; i < n; ++i) { if (!strcasecmp("debug", words[i])) { statp->options |= RES_DEBUG; DPRINTF(statp->options & RES_DEBUG, "%s: 1\n", words[i]); @@ -208,8 +208,10 @@ static void get_resolv(res_state statp) } } /* Options line */ - else if (!strncasecmp("options", words[0], sizes[0])) + else if (!strncasecmp("options", words[0], sizes[0])) { get_options(statp, i - 1, &words[1]); + debug = statp->options & RES_DEBUG; + } } } fclose(fd); -- 2.33.0 ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2/5] Cygwin: resolver: Process options forward (not backwards) 2022-01-17 18:03 ` [PATCH 2/5] Cygwin: resolver: Process options forward (not backwards) Anton Lavrentiev @ 2022-01-18 10:32 ` Corinna Vinschen 0 siblings, 0 replies; 3+ messages in thread From: Corinna Vinschen @ 2022-01-18 10:32 UTC (permalink / raw) To: cygwin-patches Hi Anton, I pushed patches 1 and 3 to 5. I fixed the consitency typo throughout. As for this path 2: On Jan 17 13:03, Anton Lavrentiev via Cygwin-patches wrote: > --- > winsup/cygwin/libc/minires.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/winsup/cygwin/libc/minires.c b/winsup/cygwin/libc/minires.c > index 0cf9efd9b..fdc6087f5 100644 > --- a/winsup/cygwin/libc/minires.c > +++ b/winsup/cygwin/libc/minires.c > @@ -86,12 +86,12 @@ Read options > > > ***********************************************************************/ > -static void get_options(res_state statp, int i, char **words) > +static void get_options(res_state statp, int n, char **words) > { > char *ptr; > - int value; > + int i, value; > > - while (i-- > 0) { > + for (i = 0; i < n; ++i) { > if (!strcasecmp("debug", words[i])) { > statp->options |= RES_DEBUG; > DPRINTF(statp->options & RES_DEBUG, "%s: 1\n", words[i]); > @@ -208,8 +208,10 @@ static void get_resolv(res_state statp) > } > } > /* Options line */ > - else if (!strncasecmp("options", words[0], sizes[0])) > + else if (!strncasecmp("options", words[0], sizes[0])) { > get_options(statp, i - 1, &words[1]); > + debug = statp->options & RES_DEBUG; This addition setting the debug flag needs a bit of explaining in the log message, me thinks. Why was it necessary or why is it better to do it here? 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? Thanks, Corinna ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-01-18 16:11 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2022-01-18 16:10 [PATCH 2/5] Cygwin: resolver: Process options forward (not backwards) Lavrentiev, Anton (NIH/NLM/NCBI) [C] -- strict thread matches above, loose matches on Subject: below -- 2022-01-17 18:03 Anton Lavrentiev 2022-01-17 18:03 ` [PATCH 2/5] Cygwin: resolver: Process options forward (not backwards) Anton Lavrentiev 2022-01-18 10:32 ` Corinna Vinschen
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).