From a711dd4ba8f2c71a260a3f7539c0e86175f97a21 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 21 Apr 2000 16:15:11 +0000 Subject: Update. 2000-04-21 Ulrich Drepper * iconv/iconv.c (iconv): Add __builtin_expect where useful. * iconv/iconv_close.c (iconv_close): Likewise. * iconv/iconv_open.c (iconv_open): Likewise. * grp/putgrent.c (putgrent): Unlock steam if fprintf failed. Add __builtin_expect where useful. * grp/initgroups.c (initgroups): Test for result of memory allocation and punt if it fails. * dirent/scandir.c (scandir): Add __builtin_expect where useful. * grp/fgetgrent.c (fgetfrent): Likewise. * grp/fgetgrent_r.c (__fgetgrent_r): Likewise. --- grp/fgetgrent.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'grp/fgetgrent.c') 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. */ -- cgit v1.2.3