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.
This commit is contained in:
Ulrich Drepper 2000-07-17 22:09:30 +00:00
parent 7f53da19c1
commit 8114530a31
10 changed files with 100 additions and 52 deletions

View File

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

View File

@ -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. */

View File

@ -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;
}

View File

@ -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);

View File

@ -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,

View File

@ -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 */

View File

@ -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");
}

View File

@ -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;

View File

@ -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;

View File

@ -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. */