From df0881d4bf994d57ea30b3b2237f3ffdf627b246 Mon Sep 17 00:00:00 2001 From: drepper Date: Fri, 21 Apr 2000 15:59:39 +0000 Subject: [PATCH] (scandir): Add __builtin_expect where useful. --- grp/fgetgrent.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grp/fgetgrent.c b/grp/fgetgrent.c index 245524f178..69507d97e7 100644 --- a/grp/fgetgrent.c +++ b/grp/fgetgrent.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1996, 1997, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1996, 1997, 1999, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -38,7 +38,7 @@ fgetgrent (FILE *stream) struct group *result; int save; - if (fgetpos (stream, &pos) != 0) + if (__builtin_expect (fgetpos (stream, &pos), 0) != 0) return NULL; /* Get lock. */ @@ -58,7 +58,7 @@ fgetgrent (FILE *stream) char *new_buf; buffer_size += NSS_BUFLEN_GROUP; new_buf = realloc (buffer, buffer_size); - if (new_buf == NULL) + if (__builtin_expect (new_buf == NULL, 0)) { /* We are out of memory. Free the current buffer so that the process gets a chance for a normal termination. */ -- 2.11.0