summary refs log tree commit diff
path: root/grp/fgetgrent_r.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-04-21 16:15:11 +0000
committerUlrich Drepper <drepper@redhat.com>2000-04-21 16:15:11 +0000
commita711dd4ba8f2c71a260a3f7539c0e86175f97a21 (patch)
tree1bf9e3eb9a49f3b9cdcd0dee9515339486170f74 /grp/fgetgrent_r.c
parent761df3a7aa6eb65aa66c78e6c1da627e453de458 (diff)
downloadglibc-a711dd4ba8f2c71a260a3f7539c0e86175f97a21.tar.gz
glibc-a711dd4ba8f2c71a260a3f7539c0e86175f97a21.tar.xz
glibc-a711dd4ba8f2c71a260a3f7539c0e86175f97a21.zip
Update.
2000-04-21  Ulrich Drepper  <drepper@redhat.com>

	* 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.
Diffstat (limited to 'grp/fgetgrent_r.c')
-rw-r--r--grp/fgetgrent_r.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/grp/fgetgrent_r.c b/grp/fgetgrent_r.c
index 0b1d782586..058b0b3e74 100644
--- a/grp/fgetgrent_r.c
+++ b/grp/fgetgrent_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1996-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
@@ -70,14 +70,14 @@ __fgetgrent_r (FILE *stream, struct group *resbuf, char *buffer, size_t buflen,
     {
       buffer[buflen - 1] = '\xff';
       p = fgets_unlocked (buffer, buflen, stream);
-      if (p == NULL && feof_unlocked (stream))
+      if (__builtin_expect (p == NULL, 0) && feof_unlocked (stream))
 	{
 	  funlockfile (stream);
 	  *result = NULL;
 	  __set_errno (ENOENT);
 	  return errno;
 	}
-      if (p == NULL || buffer[buflen - 1] != '\xff')
+      if (__builtin_expect (p == NULL, 0) || buffer[buflen - 1] != '\xff')
 	{
 	  funlockfile (stream);
 	  *result = NULL;
@@ -97,7 +97,7 @@ __fgetgrent_r (FILE *stream, struct group *resbuf, char *buffer, size_t buflen,
 
   funlockfile (stream);
 
-  if (parse_result == -1)
+  if (__builtin_expect (parse_result, 0) == -1)
     {
       /* The parser ran out of space.  */
       *result = NULL;