about summary refs log tree commit diff
path: root/grp
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 /grp
parent1448f3244714a9dabb5240ec18b094f100887d5c (diff)
downloadglibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar.gz
glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar.xz
glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.zip
Use glibc_likely instead __builtin_expect.
Diffstat (limited to 'grp')
-rw-r--r--grp/compat-initgroups.c2
-rw-r--r--grp/fgetgrent.c2
-rw-r--r--grp/initgroups.c4
-rw-r--r--grp/putgrent.c2
4 files changed, 5 insertions, 5 deletions
diff --git a/grp/compat-initgroups.c b/grp/compat-initgroups.c
index 260c4826c2..ff10e247f4 100644
--- a/grp/compat-initgroups.c
+++ b/grp/compat-initgroups.c
@@ -82,7 +82,7 @@ compat_call (service_user *nip, const char *user, gid_t group, long int *start,
 		  {
 		    /* Matches user and not yet on the list.  Insert
 		       this group.  */
-		    if (__builtin_expect (*start == *size, 0))
+		    if (__glibc_unlikely (*start == *size))
 		      {
 			/* Need a bigger buffer.  */
 			gid_t *newgroups;
diff --git a/grp/fgetgrent.c b/grp/fgetgrent.c
index 2ab64d23fd..38c83833ae 100644
--- a/grp/fgetgrent.c
+++ b/grp/fgetgrent.c
@@ -57,7 +57,7 @@ fgetgrent (FILE *stream)
       char *new_buf;
       buffer_size += NSS_BUFLEN_GROUP;
       new_buf = realloc (buffer, buffer_size);
-      if (__builtin_expect (new_buf == NULL, 0))
+      if (__glibc_unlikely (new_buf == NULL))
 	{
 	  /* We are out of memory.  Free the current buffer so that the
 	     process gets a chance for a normal termination.  */
diff --git a/grp/initgroups.c b/grp/initgroups.c
index a2b6d31fd9..bdde097b0f 100644
--- a/grp/initgroups.c
+++ b/grp/initgroups.c
@@ -159,7 +159,7 @@ getgrouplist (const char *user, gid_t group, gid_t *groups, int *ngroups)
   long int size = MAX (1, *ngroups);
 
   gid_t *newgroups = (gid_t *) malloc (size * sizeof (gid_t));
-  if (__builtin_expect (newgroups == NULL, 0))
+  if (__glibc_unlikely (newgroups == NULL))
     /* No more memory.  */
     // XXX This is wrong.  The user provided memory, we have to use
     // XXX it.  The internal functions must be called with the user
@@ -212,7 +212,7 @@ initgroups (const char *user, gid_t group)
     size = 16;
 
   groups = (gid_t *) malloc (size * sizeof (gid_t));
-  if (__builtin_expect (groups == NULL, 0))
+  if (__glibc_unlikely (groups == NULL))
     /* No more memory.  */
     return -1;
 
diff --git a/grp/putgrent.c b/grp/putgrent.c
index bb429277e5..029415fcbd 100644
--- a/grp/putgrent.c
+++ b/grp/putgrent.c
@@ -33,7 +33,7 @@ putgrent (gr, stream)
 {
   int retval;
 
-  if (__builtin_expect (gr == NULL, 0) || __builtin_expect (stream == NULL, 0))
+  if (__glibc_unlikely (gr == NULL) || __glibc_unlikely (stream == NULL))
     {
       __set_errno (EINVAL);
       return -1;