[RFC,1/4] resolv: improve comments about nserv and nservall

Message ID 1401838603-22101-2-git-send-email-aurelien@aurel32.net
State Superseded
Headers

Commit Message

Aurelien Jarno June 3, 2014, 11:36 p.m. UTC
  The current comments concerning nserv and nservall are not really clear
and lead to confusion when reviewing an already complex code. Improve
them, there real meaning have been confirmed by a code analysis.
---
 resolv/res_init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Siddhesh Poyarekar June 9, 2014, 9:47 a.m. UTC | #1
Looks good, but needs a ChangeLog.  Once you've committed it, please
change the state of the patch to 'Committed' on patchwork:

http://patchwork.sourceware.org/patch/1274/

Siddhesh

On Wed, Jun 04, 2014 at 01:36:40AM +0200, Aurelien Jarno wrote:
> The current comments concerning nserv and nservall are not really clear
> and lead to confusion when reviewing an already complex code. Improve
> them, there real meaning have been confirmed by a code analysis.
> ---
>  resolv/res_init.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/resolv/res_init.c b/resolv/res_init.c
> index ea133f8..bdec4d9 100644
> --- a/resolv/res_init.c
> +++ b/resolv/res_init.c
> @@ -153,9 +153,9 @@ __res_vinit(res_state statp, int preinit) {
>  	char *cp, **pp;
>  	int n;
>  	char buf[BUFSIZ];
> -	int nserv = 0;    /* number of nameserver records read from file */
> +	int nserv = 0;    /* number of IPv4 nameservers read from file */
>  #ifdef _LIBC
> -	int nservall = 0; /* number of NS records read, nserv IPv4 only */
> +	int nservall = 0; /* number of (IPv4 + IPV6) nameservers read from file */
>  #endif
>  	int haveenv = 0;
>  	int havesearch = 0;
> -- 
> 2.0.0.rc0
>
  

Patch

diff --git a/resolv/res_init.c b/resolv/res_init.c
index ea133f8..bdec4d9 100644
--- a/resolv/res_init.c
+++ b/resolv/res_init.c
@@ -153,9 +153,9 @@  __res_vinit(res_state statp, int preinit) {
 	char *cp, **pp;
 	int n;
 	char buf[BUFSIZ];
-	int nserv = 0;    /* number of nameserver records read from file */
+	int nserv = 0;    /* number of IPv4 nameservers read from file */
 #ifdef _LIBC
-	int nservall = 0; /* number of NS records read, nserv IPv4 only */
+	int nservall = 0; /* number of (IPv4 + IPV6) nameservers read from file */
 #endif
 	int haveenv = 0;
 	int havesearch = 0;