about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-07-17 22:09:30 +0000
committerUlrich Drepper <drepper@redhat.com>2000-07-17 22:09:30 +0000
commit8114530a31e03aec4085f79971c2a3b9e940eae3 (patch)
treeb0b003fab3e4416cb3c35281827a377365a04e34
parent7f53da19c11c141d4d4d24417b3a72bbaf755d2c (diff)
downloadglibc-8114530a31e03aec4085f79971c2a3b9e940eae3.tar.gz
glibc-8114530a31e03aec4085f79971c2a3b9e940eae3.tar.xz
glibc-8114530a31e03aec4085f79971c2a3b9e940eae3.zip
Update.
2000-07-17  Bruno Haible  <haible@clisp.cons.org>

	* iconv/gconv_open.c (__gconv_open): Initialize the __data
	field of struct __gconv_trans_data differently.  Don't pass NULL to
	trans_init_fct.  Simplify list append operation.

2000-07-14  Bruno Haible  <haible@clisp.cons.org>

	* intl/dcigettext.c (dcigettext): Call plural_eval on all platforms,
	not only those having tsearch.

2000-07-17  Ulrich Drepper  <drepper@redhat.com>

	* locale/langinfo.h: Add placeholder values in enum for removed
	LC_CTYPE entries.

2000-07-17  Jakub Jelinek  <jakub@redhat.com>

	* elf/dl-addr.c (_dl_addr): Keep searching in the _dl_loaded
	chain if the PHDR check fails.

2000-07-17  Mark Kettenis  <kettenis@gnu.org>

	* nss/getent.c (print_hosts): Make sure we always print a space
	between numeric addresses and hostnames.

2000-07-17  Wolfram Gloger  <wg@malloc.de>

	* malloc/malloc.c (chunk_alloc): Use mmap_chunk() only if allowed,
	i.e. if n_mmaps_max>0.

2000-07-16  Mark Kettenis  <kettenis@gnu.org>

	* resolv/netdb.h (AI_V4MAPPED, AI_ALL, AI_ADDRCONFIG): Adjust
	values to remove possible clash with other AI_* constants.
	(AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST): Define as
	hexadecimal constants to stress the fact they're in fact
	bit flags.

2000-07-15  Mark Kettenis  <kettenis@gnu.org>

	* nss/getXXent_r.c [NEED__RES]: Include <resolv.h>.
	(SETFUNC_NAME, ENDFUNC_NAME, REENTRANT_GETNAME): Use res_ninit
	instead of res_init.
-rw-r--r--ChangeLog45
-rw-r--r--elf/dl-addr.c32
-rw-r--r--iconv/gconv_open.c20
-rw-r--r--intl/dcigettext.c21
-rw-r--r--locale/langinfo.h3
-rw-r--r--malloc/malloc.c4
-rw-r--r--nscd/nscd.c2
-rw-r--r--nss/getXXent_r.c10
-rw-r--r--nss/getent.c3
-rw-r--r--resolv/netdb.h12
10 files changed, 100 insertions, 52 deletions
diff --git a/ChangeLog b/ChangeLog
index b4ccb45d2b..6f52f34abe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,48 @@
+2000-07-17  Bruno Haible  <haible@clisp.cons.org>
+
+	* iconv/gconv_open.c (__gconv_open): Initialize the __data
+	field of struct __gconv_trans_data differently.  Don't pass NULL to
+	trans_init_fct.  Simplify list append operation.
+
+2000-07-14  Bruno Haible  <haible@clisp.cons.org>
+
+	* intl/dcigettext.c (dcigettext): Call plural_eval on all platforms,
+	not only those having tsearch.
+
+2000-07-17  Ulrich Drepper  <drepper@redhat.com>
+
+	* locale/langinfo.h: Add placeholder values in enum for removed
+	LC_CTYPE entries.
+
+2000-07-17  Jakub Jelinek  <jakub@redhat.com>
+
+	* elf/dl-addr.c (_dl_addr): Keep searching in the _dl_loaded
+	chain if the PHDR check fails.
+
+2000-07-17  Mark Kettenis  <kettenis@gnu.org>
+
+	* nss/getent.c (print_hosts): Make sure we always print a space
+	between numeric addresses and hostnames.
+
+2000-07-17  Wolfram Gloger  <wg@malloc.de>
+
+	* malloc/malloc.c (chunk_alloc): Use mmap_chunk() only if allowed,
+	i.e. if n_mmaps_max>0.
+
+2000-07-16  Mark Kettenis  <kettenis@gnu.org>
+
+	* resolv/netdb.h (AI_V4MAPPED, AI_ALL, AI_ADDRCONFIG): Adjust
+	values to remove possible clash with other AI_* constants.
+	(AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST): Define as
+	hexadecimal constants to stress the fact they're in fact
+	bit flags.
+
+2000-07-15  Mark Kettenis  <kettenis@gnu.org>
+
+	* nss/getXXent_r.c [NEED__RES]: Include <resolv.h>.
+	(SETFUNC_NAME, ENDFUNC_NAME, REENTRANT_GETNAME): Use res_ninit
+	instead of res_init.
+
 2000-07-16  Ulrich Drepper  <drepper@redhat.com>
 
 	* crypt/md5-crypt.c (__md5_crypt_r): Add casts for first
diff --git a/elf/dl-addr.c b/elf/dl-addr.c
index d3adf12c67..2fda238cfb 100644
--- a/elf/dl-addr.c
+++ b/elf/dl-addr.c
@@ -36,27 +36,25 @@ _dl_addr (const void *address, Dl_info *info)
   for (l = _dl_loaded; l; l = l->l_next)
     if (addr >= l->l_map_start && addr < l->l_map_end)
       {
+	/* We know ADDRESS lies within L if in any shared object.
+	   Make sure it isn't past the end of L's segments.  */
+	size_t n = l->l_phnum;
+	if (n > 0)
+	  {
+	    do
+	      --n;
+	    while (l->l_phdr[n].p_type != PT_LOAD);
+	    if (addr >= (l->l_addr +
+			 l->l_phdr[n].p_vaddr + l->l_phdr[n].p_memsz))
+	      /* Off the end of the highest-addressed shared object.  */
+	      continue;
+	  }
+
 	match = l;
 	break;
       }
 
-  if (__builtin_expect (match != NULL, 1))
-    {
-      /* We know ADDRESS lies within MATCH if in any shared object.
-	 Make sure it isn't past the end of MATCH's segments.  */
-      size_t n = match->l_phnum;
-      if (n > 0)
-	{
-	  do
-	    --n;
-	  while (match->l_phdr[n].p_type != PT_LOAD);
-	  if (addr >= (match->l_addr +
-		       match->l_phdr[n].p_vaddr + match->l_phdr[n].p_memsz))
-	    /* Off the end of the highest-addressed shared object.  */
-	    return 0;
-	}
-    }
-  else
+  if (match == NULL)
     return 0;
 
   /* Now we know what object the address lies in.  */
diff --git a/iconv/gconv_open.c b/iconv/gconv_open.c
index bbe732c88a..842bf73566 100644
--- a/iconv/gconv_open.c
+++ b/iconv/gconv_open.c
@@ -212,13 +212,13 @@ __gconv_open (const char *toset, const char *fromset, __gconv_t *handle,
 
 		      /* Match!  Now try the initializer.  */
 		      if (runp->trans_init_fct == NULL
-			  || (runp->trans_init_fct (data, steps[cnt].__to_name)
+			  || (runp->trans_init_fct (&data,
+						    steps[cnt].__to_name)
 			      == __GCONV_OK))
 			{
 			  /* Append at the end of the list.  */
 			  struct __gconv_trans_data *newp;
-			  struct __gconv_trans_data *endp;
-			  struct __gconv_trans_data *lastp;
+			  struct __gconv_trans_data **lastp;
 
 			  newp = (struct __gconv_trans_data *)
 			    malloc (sizeof (struct __gconv_trans_data));
@@ -228,18 +228,14 @@ __gconv_open (const char *toset, const char *fromset, __gconv_t *handle,
 			  newp->__trans_fct = runp->trans_fct;
 			  newp->__trans_context_fct = runp->trans_context_fct;
 			  newp->__trans_end_fct = runp->trans_end_fct;
-			  newp->__data = NULL;
+			  newp->__data = data;
 			  newp->__next = NULL;
 
-			  lastp = NULL;
-			  for (endp = result->__data[cnt].__trans;
-			       endp != NULL; endp = endp->__next)
-			    lastp = endp;
+			  lastp = &result->__data[cnt].__trans;
+			  while (*lastp != NULL)
+			    lastp = &(*lastp)->__next;
 
-			  if (lastp == NULL)
-			    result->__data[cnt].__trans = newp;
-			  else
-			    lastp->__next = newp;
+			  *lastp = newp;
 			}
 		      break;
 		    }
diff --git a/intl/dcigettext.c b/intl/dcigettext.c
index ed470b4ee6..fcbc130a26 100644
--- a/intl/dcigettext.c
+++ b/intl/dcigettext.c
@@ -553,24 +553,25 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category)
       if (domain != NULL)
 	{
 	  unsigned long int index = 0;
-#if defined HAVE_TSEARCH || defined _LIBC
-	  struct loaded_domain *domaindata =
-	    (struct loaded_domain *) domain->data;
 
 	  if (plural != 0)
 	    {
+	      struct loaded_domain *domaindata =
+		(struct loaded_domain *) domain->data;
+	      index = plural_eval (domaindata->plural, n);
+	      if (index >= domaindata->nplurals)
+		/* This should never happen.  It means the plural expression
+		   and the given maximum value do not match.  */
+		index = 0;
+
+#if defined HAVE_TSEARCH || defined _LIBC
 	      /* Try to find the translation among those which we
 		 found at some time.  */
 	      search = (struct known_translation_t *) alloca (sizeof (*search)
 							      + msgid_len);
 	      memcpy (search->msgid, msgid1, msgid_len);
 	      search->domain = (char *) domainname;
-	      search->plindex = plural_eval (domaindata->plural, n);
-	      if (search->plindex >= domaindata->nplurals)
-		/* This should never happen.  It means the plural expression
-		   and the given maximum value do not match.  */
-		search->plindex = 0;
-	      index = search->plindex;
+	      search->plindex = index;
 	      search->category = category;
 
 	      foundp = (struct known_translation_t **) tfind (search, &root,
@@ -580,8 +581,8 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category)
 		  __libc_rwlock_unlock (_nl_state_lock);
 		  return (char *) (*foundp)->translation;
 		}
-	    }
 #endif
+	    }
 
 	  retval = _nl_find_msg (domain, msgid1, index);
 
diff --git a/locale/langinfo.h b/locale/langinfo.h
index 6425dec592..d2cc2a8672 100644
--- a/locale/langinfo.h
+++ b/locale/langinfo.h
@@ -257,9 +257,12 @@ enum
      These `nl_langinfo' names are used only internally.  */
   _NL_CTYPE_CLASS = _NL_ITEM (LC_CTYPE, 0),
   _NL_CTYPE_TOUPPER,
+  _NL_CTYPE_GAP1,
   _NL_CTYPE_TOLOWER,
+  _NL_CTYPE_GAP2,
   _NL_CTYPE_CLASS32,
   _NL_CTYPE_NAMES,
+  _NL_CTYPE_GAP3,
   _NL_CTYPE_HASH_SIZE,
   _NL_CTYPE_HASH_LAYERS,
   _NL_CTYPE_CLASS_NAMES,
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 8eed746fff..f2246f6184 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -2942,8 +2942,8 @@ chunk_alloc(ar_ptr, nb) arena *ar_ptr; INTERNAL_SIZE_T nb;
     {
 #if HAVE_MMAP
       /* A last attempt:  when we are out of address space in the arena,
-         try mmap anyway, disregarding n_mmaps_max.  */
-      if((victim = mmap_chunk(nb)) != 0)
+         try mmap anyway, as long as it is allowed at all.  */
+      if (n_mmaps_max > 0 && (victim = mmap_chunk(nb)) != 0)
         return victim;
 #endif
       return 0; /* propagate failure */
diff --git a/nscd/nscd.c b/nscd/nscd.c
index 1269a914d7..409f9c1f1c 100644
--- a/nscd/nscd.c
+++ b/nscd/nscd.c
@@ -288,7 +288,7 @@ print_version (FILE *stream, struct argp_state *state)
 Copyright (C) %s Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.  There is NO\n\
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "1999");
+"), "2000");
   fprintf (stream, gettext ("Written by %s.\n"),
 	   "Thorsten Kukuk and Ulrich Drepper");
 }
diff --git a/nss/getXXent_r.c b/nss/getXXent_r.c
index e0ba98b59a..4e45ec1c15 100644
--- a/nss/getXXent_r.c
+++ b/nss/getXXent_r.c
@@ -22,6 +22,10 @@
 
 #include "nsswitch.h"
 
+#ifdef NEED__RES
+# include <resolv.h>
+#endif
+
 /*******************************************************************\
 |* Here we assume several symbols to be defined:		   *|
 |* 								   *|
@@ -149,7 +153,7 @@ SETFUNC_NAME (STAYOPEN)
   int no_more;
 
 #ifdef NEED__RES
-  if ((_res.options & RES_INIT) == 0 && res_init () == -1)
+  if ((_res.options & RES_INIT) == 0 && __res_ninit (&_res) == -1)
     {
       __set_h_errno (NETDB_INTERNAL);
       return;
@@ -187,7 +191,7 @@ ENDFUNC_NAME (void)
   int no_more;
 
 #ifdef NEED__RES
-  if ((_res.options & RES_INIT) == 0 && res_init () == -1)
+  if ((_res.options & RES_INIT) == 0 && __res_ninit (&_res) == -1)
     {
       __set_h_errno (NETDB_INTERNAL);
       return;
@@ -224,7 +228,7 @@ INTERNAL (REENTRANT_GETNAME) (LOOKUP_TYPE *resbuf, char *buffer, size_t buflen,
   enum nss_status status;
 
 #ifdef NEED__RES
-  if ((_res.options & RES_INIT) == 0 && res_init () == -1)
+  if ((_res.options & RES_INIT) == 0 && __res_ninit (&_res) == -1)
     {
       __set_h_errno (NETDB_INTERNAL);
       *result = NULL;
diff --git a/nss/getent.c b/nss/getent.c
index d3a9fde1e1..5834d790a0 100644
--- a/nss/getent.c
+++ b/nss/getent.c
@@ -257,8 +257,9 @@ print_hosts (struct hostent *host)
 			      buf, sizeof (buf));
 
   fputs (ip, stdout);
-  for (i = strlen (ip); i < 16; ++i)
+  for (i = strlen (ip); i < 15; ++i)
     fputs (" ", stdout);
+  fputs (" ", stdout);
   fputs (host->h_name, stdout);
 
   i = 0;
diff --git a/resolv/netdb.h b/resolv/netdb.h
index f8ae4f2a33..e0331db2a7 100644
--- a/resolv/netdb.h
+++ b/resolv/netdb.h
@@ -149,9 +149,9 @@ extern struct hostent *getipnodebyaddr (__const void *__addr, socklen_t __len,
 extern struct hostent *getipnodebyname (__const char *__name, int __type,
 					int __flags, int *__error_num) __THROW;
 
-# define AI_V4MAPPED	1	/* IPv4-mapped addresses are acceptable.  */
-# define AI_ALL		2	/* Return both IPv4 and IPv6 addresses.  */
-# define AI_ADDRCONFIG	4	/* Use configuration of this host to choose
+# define AI_V4MAPPED	0x0008	/* IPv4-mapped addresses are acceptable.  */
+# define AI_ALL		0x0010	/* Return both IPv4 and IPv6 addresses.  */
+# define AI_ADDRCONFIG	0x0020	/* Use configuration of this host to choose
 				   returned address type.  */
 # define AI_DEFAULT	(AI_V4MAPPED | AI_ADDRCONFIG)
 
@@ -437,9 +437,9 @@ struct addrinfo
 };
 
 /* Possible values for `ai_flags' field in `addrinfo' structure.  */
-# define AI_PASSIVE	1	/* Socket address is intended for `bind'.  */
-# define AI_CANONNAME	2	/* Request for canonical name.  */
-# define AI_NUMERICHOST	4	/* Don't use name resolution.  */
+# define AI_PASSIVE	0x0001	/* Socket address is intended for `bind'.  */
+# define AI_CANONNAME	0x0002	/* Request for canonical name.  */
+# define AI_NUMERICHOST	0x0004	/* Don't use name resolution.  */
 
 /* Error values for `getaddrinfo' function.  */
 # define EAI_BADFLAGS	-1	/* Invalid value for `ai_flags' field.  */