This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [BZ #15890][PATCH] Initialize res_hconf in nscd
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Wed, 28 Aug 2013 09:47:56 +0530
- Subject: Re: [BZ #15890][PATCH] Initialize res_hconf in nscd
- Authentication-results: sourceware.org; auth=none
- References: <20130826063650 dot GD2011 at spoyarek dot pnq dot redhat dot com> <20130827165341 dot 1AFF02C0B1 at topped-with-meat dot com>
On Tue, Aug 27, 2013 at 09:53:41AM -0700, Roland McGrath wrote:
> > + /* Initialize configurations. */
> > + if (__builtin_expect (!_res_hconf.initialized, 0))
> > + _res_hconf_init ();
>
> __glibc_unlikely
Thanks, I've fixed both instances of this - in getaddrinfo where I
cribbed it from and this instance.
Siddhesh
commit 3a3092398356c90788479fa75524a491e9d860cd
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date: Wed Aug 28 09:44:19 2013 +0530
Use __glibc_unlikely instead of __builtin_expect (..., 0)
diff --git a/ChangeLog b/ChangeLog
index 6e418e7..06ecaab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-08-28 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * nscd/aicache.c (addhstaiX): Use __glibc_unlikely.
+ * sysdeps/posix/getaddrinfo.c (gaih_inet): Likewise.
+
2013-08-27 Mike Frysinger <vapier@gentoo.org>
[BZ #15897]
diff --git a/nscd/aicache.c b/nscd/aicache.c
index dceb4d6..fd55852 100644
--- a/nscd/aicache.c
+++ b/nscd/aicache.c
@@ -102,7 +102,7 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req,
"dns [!UNAVAIL=return] files", &nip);
/* Initialize configurations. */
- if (__builtin_expect (!_res_hconf.initialized, 0))
+ if (__glibc_unlikely (!_res_hconf.initialized))
_res_hconf_init ();
if (__res_maybe_init (&_res, 0) == -1)
no_more = 1;
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 7bb3ded..52177e4 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -802,7 +802,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
&nip);
/* Initialize configurations. */
- if (__builtin_expect (!_res_hconf.initialized, 0))
+ if (__glibc_unlikely (!_res_hconf.initialized))
_res_hconf_init ();
if (__res_maybe_init (&_res, 0) == -1)
no_more = 1;