summaryrefslogtreecommitdiff
path: root/nscd/nscd_helper.c
diff options
context:
space:
mode:
authorOndřej Bílka <neleai@seznam.cz>2014-02-10 14:45:42 +0100
committerOndřej Bílka <neleai@seznam.cz>2014-02-10 15:07:12 +0100
commita1ffb40e32741f992c743e7b16c061fefa3747ac (patch)
tree246a29a87b26cfd5d07b17070f85eb3785018de9 /nscd/nscd_helper.c
parent1448f3244714a9dabb5240ec18b094f100887d5c (diff)
downloadglibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar.gz
Use glibc_likely instead __builtin_expect.
Diffstat (limited to 'nscd/nscd_helper.c')
-rw-r--r--nscd/nscd_helper.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/nscd/nscd_helper.c b/nscd/nscd_helper.c
index e4fb2e59f8..0d61643f10 100644
--- a/nscd/nscd_helper.c
+++ b/nscd/nscd_helper.c
@@ -110,7 +110,7 @@ __readvall (int fd, const struct iovec *iov, int iovcnt)
ssize_t ret = TEMP_FAILURE_RETRY (__readv (fd, iov, iovcnt));
if (ret <= 0)
{
- if (__builtin_expect (ret == 0 || errno != EAGAIN, 1))
+ if (__glibc_likely (ret == 0 || errno != EAGAIN))
/* A genuine error or no data to read. */
return ret;
@@ -226,7 +226,7 @@ open_socket (request_type type, const char *key, size_t keylen)
ssize_t wres = TEMP_FAILURE_RETRY (__send (sock, &reqdata,
real_sizeof_reqdata,
MSG_NOSIGNAL));
- if (__builtin_expect (wres == (ssize_t) real_sizeof_reqdata, 1))
+ if (__glibc_likely (wres == (ssize_t) real_sizeof_reqdata))
/* We managed to send the request. */
return sock;
@@ -339,13 +339,13 @@ __nscd_get_mapping (request_type type, const char *key,
int *ip = (void *) CMSG_DATA (cmsg);
mapfd = *ip;
- if (__builtin_expect (n != keylen && n != keylen + sizeof (mapsize), 0))
+ if (__glibc_unlikely (n != keylen && n != keylen + sizeof (mapsize)))
goto out_close;
- if (__builtin_expect (strcmp (resdata, key) != 0, 0))
+ if (__glibc_unlikely (strcmp (resdata, key) != 0))
goto out_close;
- if (__builtin_expect (n == keylen, 0))
+ if (__glibc_unlikely (n == keylen))
{
struct stat64 st;
if (__builtin_expect (fstat64 (mapfd, &st) != 0, 0)
@@ -358,7 +358,7 @@ __nscd_get_mapping (request_type type, const char *key,
/* The file is large enough, map it now. */
void *mapping = __mmap (NULL, mapsize, PROT_READ, MAP_SHARED, mapfd, 0);
- if (__builtin_expect (mapping != MAP_FAILED, 1))
+ if (__glibc_likely (mapping != MAP_FAILED))
{
/* Check whether the database is correct and up-to-date. */
struct database_pers_head *head = mapping;
@@ -383,7 +383,7 @@ __nscd_get_mapping (request_type type, const char *key,
ALIGN)
+ head->data_size);
- if (__builtin_expect (mapsize < size, 0))
+ if (__glibc_unlikely (mapsize < size))
goto out_unmap;
/* Allocate a record for the mapping. */
@@ -433,7 +433,7 @@ __nscd_get_map_ref (request_type type, const char *name,
cur = mapptr->mapped;
- if (__builtin_expect (cur != NO_MAPPING, 1))
+ if (__glibc_likely (cur != NO_MAPPING))
{
/* If not mapped or timestamp not updated, request new map. */
if (cur == NULL
@@ -443,7 +443,7 @@ __nscd_get_map_ref (request_type type, const char *name,
cur = __nscd_get_mapping (type, name,
(struct mapped_database **) &mapptr->mapped);
- if (__builtin_expect (cur != NO_MAPPING, 1))
+ if (__glibc_likely (cur != NO_MAPPING))
{
if (__builtin_expect (((*gc_cyclep = cur->head->gc_cycle) & 1) != 0,
0))