[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r12566 - in /fsf/trunk/libc: ChangeLog NEWS nscd/hstcache.c



Author: eglibc
Date: Sun Jan 16 00:03:11 2011
New Revision: 12566

Log:
Import glibc-mainline for 2011-01-16

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/NEWS
    fsf/trunk/libc/nscd/hstcache.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sun Jan 16 00:03:11 2011
@@ -1,3 +1,11 @@
+2011-01-15  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	[BZ #6812]
+	* nscd/hstcache.c (tryagain): Define.
+	(cache_addhst): Return tryagain not notfound for temporary errors.
+	(addhstbyX): Also set h_errno to TRY_AGAIN when memory allocation
+	failed.
+
 2011-01-14  Ulrich Drepper  <drepper@xxxxxxxxx>
 
 	[BZ #10563]

Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Sun Jan 16 00:03:11 2011
@@ -1,4 +1,4 @@
-GNU C Library NEWS -- history of user-visible changes.  2011-1-14
+GNU C Library NEWS -- history of user-visible changes.  2011-1-15
 Copyright (C) 1992-2009, 2010, 2011 Free Software Foundation, Inc.
 See the end for copying conditions.
 
@@ -9,11 +9,11 @@
 
 * The following bugs are resolved with this release:
 
-  3268, 7066, 10085, 10484, 10563, 10851, 11149, 11155, 11611, 11640, 11655,
-  11701, 11840, 11856, 11883, 11903, 11904, 11968, 11979, 12005, 12037,
-  12067, 12077, 12078, 12092, 12093, 12107, 12108, 12113, 12140, 12159,
-  12167, 12191, 12194, 12201, 12204, 12205, 12207, 12348, 12378, 12394,
-  12397
+  3268, 6812, 7066, 10085, 10484, 10563, 10851, 11149, 11155, 11611, 11640,
+  11655, 11701, 11840, 11856, 11883, 11903, 11904, 11968, 11979, 12005,
+  12037, 12067, 12077, 12078, 12092, 12093, 12107, 12108, 12113, 12140,
+  12159, 12167, 12191, 12194, 12201, 12204, 12205, 12207, 12348, 12378,
+  12394, 12397
 
 * New Linux interfaces: prlimit, prlimit64, fanotify_init, fanotify_mark
 

Modified: fsf/trunk/libc/nscd/hstcache.c
==============================================================================
--- fsf/trunk/libc/nscd/hstcache.c (original)
+++ fsf/trunk/libc/nscd/hstcache.c Sun Jan 16 00:03:11 2011
@@ -1,5 +1,5 @@
 /* Cache handling for host lookup.
-   Copyright (C) 1998-2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 1998-2008, 2009, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1998.
 
@@ -77,6 +77,20 @@
 };
 
 
+/* This is the standard reply in case there are temporary problems.  */
+static const hst_response_header tryagain =
+{
+  .version = NSCD_VERSION,
+  .found = 0,
+  .h_name_len = 0,
+  .h_aliases_cnt = 0,
+  .h_addrtype = -1,
+  .h_length = -1,
+  .h_addr_list_cnt = 0,
+  .error = TRY_AGAIN
+};
+
+
 static void
 cache_addhst (struct database_dyn *db, int fd, request_header *req,
 	      const void *key, struct hostent *hst, uid_t owner,
@@ -111,11 +125,15 @@
       else
 	{
 	  /* We have no data.  This means we send the standard reply for this
-	     case.  */
+	     case.  Possibly this is only temporary.  */
 	  ssize_t total = sizeof (notfound);
+	  assert (sizeof (notfound) == sizeof (tryagain));
+
+	  const hst_response_header *resp = (errval == EAGAIN
+					     ? &tryagain : &notfound);
 
 	  if (fd != -1 &&
-	      TEMP_FAILURE_RETRY (send (fd, &notfound, total,
+	      TEMP_FAILURE_RETRY (send (fd, resp, total,
 					MSG_NOSIGNAL)) != total)
 	    all_written = false;
 
@@ -135,7 +153,7 @@
 					   ? db->negtimeout : ttl);
 
 	      /* This is the reply.  */
-	      memcpy (&dataset->resp, &notfound, total);
+	      memcpy (&dataset->resp, resp, total);
 
 	      /* Copy the key data.  */
 	      memcpy (dataset->strdata, key, req->key_len);
@@ -490,6 +508,7 @@
 	      /* We set the error to indicate this is (possibly) a
 		 temporary error and that it does not mean the entry
 		 is not available at all.  */
+	      h_errno = TRY_AGAIN;
 	      errval = EAGAIN;
 	      break;
 	    }