-/* 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
struct group *result;
int save;
- if (fgetpos (stream, &pos) != 0)
+ if (__builtin_expect (fgetpos (stream, &pos), 0) != 0)
return NULL;
/* Get lock. */
}
while (buffer != NULL
- && __fgetgrent_r (stream, &resbuf, buffer, buffer_size, &result) != 0
- && errno == ERANGE)
+ && (__fgetgrent_r (stream, &resbuf, buffer, buffer_size, &result)
+ == ERANGE))
{
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. */