diff options
author | Ondřej Bílka <neleai@seznam.cz> | 2014-02-10 14:45:42 +0100 |
---|---|---|
committer | Ondřej Bílka <neleai@seznam.cz> | 2014-02-10 15:07:12 +0100 |
commit | a1ffb40e32741f992c743e7b16c061fefa3747ac (patch) | |
tree | 246a29a87b26cfd5d07b17070f85eb3785018de9 /nscd/nscd_getgr_r.c | |
parent | 1448f3244714a9dabb5240ec18b094f100887d5c (diff) | |
download | glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar.gz glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar.bz2 glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.zip |
Use glibc_likely instead __builtin_expect.
Diffstat (limited to 'nscd/nscd_getgr_r.c')
-rw-r--r-- | nscd/nscd_getgr_r.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/nscd/nscd_getgr_r.c b/nscd/nscd_getgr_r.c index ed5dc11159..d9b91a470f 100644 --- a/nscd/nscd_getgr_r.c +++ b/nscd/nscd_getgr_r.c @@ -143,7 +143,7 @@ nscd_getgr_r (const char *key, size_t keylen, request_type type, /* No value found so far. */ *result = NULL; - if (__builtin_expect (gr_resp.found == -1, 0)) + if (__glibc_unlikely (gr_resp.found == -1)) { /* The daemon does not cache this database. */ __nss_not_use_nscd_group = 1; @@ -164,7 +164,7 @@ nscd_getgr_r (const char *key, size_t keylen, request_type type, & (__alignof__ (char *) - 1)); total_len = (align + (1 + gr_resp.gr_mem_cnt) * sizeof (char *) + gr_resp.gr_name_len + gr_resp.gr_passwd_len); - if (__builtin_expect (buflen < total_len, 0)) + if (__glibc_unlikely (buflen < total_len)) { no_room: __set_errno (ERANGE); @@ -190,7 +190,7 @@ nscd_getgr_r (const char *key, size_t keylen, request_type type, if (gr_name == NULL) { /* Handle a simple, usual case: no group members. */ - if (__builtin_expect (gr_resp.gr_mem_cnt == 0, 1)) + if (__glibc_likely (gr_resp.gr_mem_cnt == 0)) { size_t n = gr_resp.gr_name_len + gr_resp.gr_passwd_len; if (__builtin_expect (__readall (sock, resultbuf->gr_name, n) @@ -217,7 +217,7 @@ nscd_getgr_r (const char *key, size_t keylen, request_type type, /* Get this data. */ size_t n = __readvall (sock, vec, 2); - if (__builtin_expect (n != total_len, 0)) + if (__glibc_unlikely (n != total_len)) goto out_close; } } @@ -239,7 +239,7 @@ nscd_getgr_r (const char *key, size_t keylen, request_type type, p += len[cnt]; } - if (__builtin_expect (gr_name + gr_name_len + total_len > recend, 0)) + if (__glibc_unlikely (gr_name + gr_name_len + total_len > recend)) { /* len array might contain garbage during nscd GC cycle, retry rather than fail in that case. */ @@ -247,7 +247,7 @@ nscd_getgr_r (const char *key, size_t keylen, request_type type, retval = -2; goto out_close; } - if (__builtin_expect (total_len > buflen, 0)) + if (__glibc_unlikely (total_len > buflen)) { /* len array might contain garbage during nscd GC cycle, retry rather than fail in that case. */ |