This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch, master, updated. glibc-2.14-195-g775a77e


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  775a77e7e43c75ce3a7960f249eb3b189889ec20 (commit)
      from  89f447edba330554fb50b19009938c8c19cc7414 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=775a77e7e43c75ce3a7960f249eb3b189889ec20

commit 775a77e7e43c75ce3a7960f249eb3b189889ec20
Author: Ulrich Drepper <drepper@gmail.com>
Date:   Sat Aug 20 15:55:44 2011 -0400

    More optimizations of nss_files

diff --git a/ChangeLog b/ChangeLog
index 5af9c0b..fadf296 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
 2011-08-20  Ulrich Drepper  <drepper@gmail.com>
 
-	* nss/nss_files/files-alias.c (get_next_alias): Use feof_unlocked.
+	* nss/nss_files/files-alias.c (get_next_alias): Use feof_unlocked
+	and fgetc_unlocked.
+	* nss/nss_files/files-key.c (search): Use fgets_unlocked and
+	getc_unlocked.
 
 	* elf/dl-open.c (add_to_global): Report additions to the global scope
 	for LD_DEBUG=scopes.
diff --git a/nss/nss_files/files-alias.c b/nss/nss_files/files-alias.c
index 0a722b9..714299a 100644
--- a/nss/nss_files/files-alias.c
+++ b/nss/nss_files/files-alias.c
@@ -335,7 +335,7 @@ get_next_alias (const char *match, struct aliasent *result,
 		     just read character.  */
 		  int ch;
 
-		  ch = fgetc (stream);
+		  ch = fgetc_unlocked (stream);
 		  if (ch == EOF || ch == '\n' || !isspace (ch))
 		    {
 		      size_t cnt;
diff --git a/nss/nss_files/files-key.c b/nss/nss_files/files-key.c
index 5c7ad09..fb108c8 100644
--- a/nss/nss_files/files-key.c
+++ b/nss/nss_files/files-key.c
@@ -1,5 +1,5 @@
 /* Public key file parser in nss_files module.
-   Copyright (C) 1996, 1997, 1998, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998, 2006, 2011 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
@@ -33,9 +33,7 @@ extern int xdecrypt (char *, char *);
 static enum nss_status
 search (const char *netname, char *result, int *errnop, int secret)
 {
-  FILE *stream;
-
-  stream = fopen (DATAFILE, "r");
+  FILE *stream = fopen (DATAFILE, "re");
   if (stream == NULL)
     return errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
 
@@ -46,7 +44,7 @@ search (const char *netname, char *result, int *errnop, int secret)
       char *save_ptr;
 
       buffer[sizeof (buffer) - 1] = '\xff';
-      p = fgets (buffer, sizeof (buffer), stream);
+      p = fgets_unlocked (buffer, sizeof (buffer), stream);
       if (p == NULL)
 	{
 	  /* End of file or read error.  */
@@ -58,7 +56,7 @@ search (const char *netname, char *result, int *errnop, int secret)
 	{
 	  /* Invalid line in file?  Skip remainder of line.  */
 	  if (buffer[sizeof (buffer) - 2] != '\0')
-	    while (getc (stream) != '\n')
+	    while (getc_unlocked (stream) != '\n')
 	      continue;
 	  continue;
 	}

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                   |    5 ++++-
 nss/nss_files/files-alias.c |    2 +-
 nss/nss_files/files-key.c   |   10 ++++------
 3 files changed, 9 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]