Skip to content

Commit

Permalink
[BZ #390]
Browse files Browse the repository at this point in the history
Update.
2004-09-18  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/unix/sysv/linux/nscd_setup_thread.c (setup_thread):
	Do nothing if __NR_set_tid_address is not defined.  [BZ #390]

2004-09-17  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/posix/getaddrinfo.c: Use gethostbyname3_r NSS function
	in case it is available.
  • Loading branch information
Ulrich Drepper committed Sep 17, 2004
1 parent f731666 commit f04b1e1
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 8 deletions.
10 changes: 10 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
2004-09-18 Jakub Jelinek <jakub@redhat.com>

* sysdeps/unix/sysv/linux/nscd_setup_thread.c (setup_thread):
Do nothing if __NR_set_tid_address is not defined. [BZ #390]

2004-09-17 Ulrich Drepper <drepper@redhat.com>

* sysdeps/posix/getaddrinfo.c: Use gethostbyname3_r NSS function
in case it is available.

2004-09-17 Jakub Jelinek <jakub@redhat.com>

* nscd/nscd.c (parse_opt): Write arg string instead of (void *)
Expand Down
4 changes: 2 additions & 2 deletions debug/execinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ extern char **backtrace_symbols (void *__const *__array, int __size)
/* This function is similar to backtrace_symbols() but it writes the result
immediately to a file and can therefore also be used in situations where
malloc() is not usable anymore. */
extern void backtrace_symbols_fd (void *__const *__array, int __size,
int __fd) __THROW __nonnull ((1));
extern void backtrace_symbols_fd (void *__const *__array, int __size, int __fd)
__THROW __nonnull ((1));

__END_DECLS

Expand Down
22 changes: 16 additions & 6 deletions sysdeps/posix/getaddrinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,12 @@ gaih_inet_serv (const char *servicename, const struct gaih_typeproto *tp,
int herrno; \
struct hostent th; \
struct hostent *h; \
char *localcanon = NULL; \
no_data = 0; \
while (1) { \
rc = 0; \
status = DL_CALL_FCT (fct, (name, _family, &th, tmpbuf, \
tmpbuflen, &rc, &herrno)); \
tmpbuflen, &rc, &herrno, NULL, &localcanon)); \
if (rc != ERANGE || herrno != NETDB_INTERNAL) \
break; \
tmpbuf = extend_alloca (tmpbuf, tmpbuflen, 2 * tmpbuflen); \
Expand Down Expand Up @@ -342,16 +343,19 @@ gaih_inet_serv (const char *servicename, const struct gaih_typeproto *tp,
pat = &((*pat)->next); \
} \
\
if (localcanon != NULL) \
canon = strdupa (localcanon); \
\
if (_family == AF_INET6 && i > 0) \
got_ipv6 = true; \
} \
}


typedef enum nss_status (*nss_gethostbyname2_r)
typedef enum nss_status (*nss_gethostbyname3_r)
(const char *name, int af, struct hostent *host,
char *buffer, size_t buflen, int *errnop,
int *h_errnop);
int *h_errnop, int32_t *ttlp, char **canonp);
typedef enum nss_status (*nss_getcanonname_r)
(const char *name, char *buffer, size_t buflen, char **result,
int *errnop, int *h_errnop);
Expand Down Expand Up @@ -771,8 +775,14 @@ gaih_inet (const char *name, const struct gaih_service *service,

while (!no_more)
{
nss_gethostbyname2_r fct
= __nss_lookup_function (nip, "gethostbyname2_r");
nss_gethostbyname3_r fct
= __nss_lookup_function (nip, "gethostbyname3_r");
if (fct == NULL)
/* We are cheating here. The gethostbyname2_r function does
not have the same interface as gethostbyname3_r but the
extra arguments the latter takes are added at the end.
So the gethostbyname2_r code will just ignore them. */
fct = __nss_lookup_function (nip, "gethostbyname2_r");

if (fct != NULL)
{
Expand Down Expand Up @@ -805,7 +815,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
if (inet6_status == NSS_STATUS_SUCCESS
|| status == NSS_STATUS_SUCCESS)
{
if ((req->ai_flags & AI_CANONNAME) != 0)
if ((req->ai_flags & AI_CANONNAME) != 0 && canon == NULL)
{
/* If we need the canonical name, get it
from the same service as the result. */
Expand Down
2 changes: 2 additions & 0 deletions sysdeps/unix/sysv/linux/nscd_setup_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
void
setup_thread (struct database_dyn *db)
{
#ifdef __NR_set_tid_address
/* Only supported when NPTL is used. */
char buf[100];
if (confstr (_CS_GNU_LIBPTHREAD_VERSION, buf, sizeof (buf)) >= sizeof (buf)
Expand All @@ -44,4 +45,5 @@ setup_thread (struct database_dyn *db)
So, set the field to a nonzero value which indicates that nscd
is certainly running and clients can skip the test. */
db->head->nscd_certainly_running = 1;
#endif
}

0 comments on commit f04b1e1

Please sign in to comment.