This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH COMMITTED] resolv: Replace __builtin_expect with __glibc_unlikely/__glibc_likely
- From: Florian Weimer <fweimer at redhat dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 19 Apr 2017 20:23:07 +0200
- Subject: Re: [PATCH COMMITTED] resolv: Replace __builtin_expect with __glibc_unlikely/__glibc_likely
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=fweimer at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com ABFD731F3E9
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com ABFD731F3E9
- References: <20170419123107.5EC36416FD367@oldenburg.str.redhat.com> <87tw5k5vu4.fsf@linux-m68k.org>
On 04/19/2017 04:13 PM, Andreas Schwab wrote:
On Apr 19 2017, fweimer@redhat.com (Florian Weimer) wrote:
@@ -633,7 +633,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
packtmp, sizeof packtmp);
if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
{
- if (__builtin_expect (errno, 0) == EMSGSIZE)
+ if (__glibc_unlikely (errno) == EMSGSIZE)
(__glibc_unlikely (errno == EMSGSIZE))
Ugh, I really didn't see this. :(
Fixed with the attached patch.
Thanks,
Florian
nss_dns: Correct parentheses for the __glibc_unlikely argument
This fixes commit bee05c9d58a34ec5886faf3b56ecaa56355d94bf.
2017-04-19 Florian Weimer <fweimer@redhat.com>
* resolv/nss_dns/dns-host.c (getanswer_r): Fix parentheses.
diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
index 7099d09..f121aa3 100644
--- a/resolv/nss_dns/dns-host.c
+++ b/resolv/nss_dns/dns-host.c
@@ -633,7 +633,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
packtmp, sizeof packtmp);
if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
{
- if (__glibc_unlikely (errno) == EMSGSIZE)
+ if (__glibc_unlikely (errno == EMSGSIZE))
goto too_small;
n = -1;