summaryrefslogtreecommitdiff
path: root/libc/nscd
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2012-02-08 16:44:31 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2012-02-08 16:44:31 +0000
commit78be84cd747c2e3965bf6c2fd5f702d6ff2f5525 (patch)
treec070a60ef7c5371bef8b7a559442a6920b394c8e /libc/nscd
parentde06548e980675e65a1e6d850bb8c3a3f7ec638d (diff)
Merge changes between r16568 and r17050 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@17051 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/nscd')
-rw-r--r--libc/nscd/aicache.c7
-rw-r--r--libc/nscd/grpcache.c7
-rw-r--r--libc/nscd/hstcache.c7
-rw-r--r--libc/nscd/initgrcache.c7
-rw-r--r--libc/nscd/mem.c7
-rw-r--r--libc/nscd/nscd.h11
-rw-r--r--libc/nscd/pwdcache.c7
-rw-r--r--libc/nscd/servicescache.c7
8 files changed, 32 insertions, 28 deletions
diff --git a/libc/nscd/aicache.c b/libc/nscd/aicache.c
index aaaf80df9..e1f12445c 100644
--- a/libc/nscd/aicache.c
+++ b/libc/nscd/aicache.c
@@ -1,5 +1,5 @@
/* Cache handling for host lookup.
- Copyright (C) 2004-2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2004-2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2004.
@@ -514,8 +514,9 @@ next_nip:
if (fd != -1)
TEMP_FAILURE_RETRY (send (fd, &notfound, total, MSG_NOSIGNAL));
- /* If we cannot permanently store the result, so be it. */
- if (__builtin_expect (db->negtimeout == 0, 0))
+ /* If we have a transient error or cannot permanently store the
+ result, so be it. */
+ if (rc4 == EAGAIN || __builtin_expect (db->negtimeout == 0, 0))
{
/* Mark the old entry as obsolete. */
if (dh != NULL)
diff --git a/libc/nscd/grpcache.c b/libc/nscd/grpcache.c
index e9607c6f1..a698f363c 100644
--- a/libc/nscd/grpcache.c
+++ b/libc/nscd/grpcache.c
@@ -1,5 +1,5 @@
/* Cache handling for group lookup.
- Copyright (C) 1998-2008, 2009, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1998-2008, 2009, 2011, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -120,8 +120,9 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req,
else
written = total;
- /* If we cannot permanently store the result, so be it. */
- if (db->negtimeout == 0)
+ /* If we have a transient error or cannot permanently store
+ the result, so be it. */
+ if (errno == EAGAIN || __builtin_expect (db->negtimeout == 0, 0))
{
/* Mark the old entry as obsolete. */
if (dh != NULL)
diff --git a/libc/nscd/hstcache.c b/libc/nscd/hstcache.c
index 4d68ade98..c72feaa02 100644
--- a/libc/nscd/hstcache.c
+++ b/libc/nscd/hstcache.c
@@ -1,5 +1,5 @@
/* Cache handling for host lookup.
- Copyright (C) 1998-2008, 2009, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1998-2008, 2009, 2011, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -141,8 +141,9 @@ cache_addhst (struct database_dyn *db, int fd, request_header *req,
MSG_NOSIGNAL)) != total)
all_written = false;
- /* If we cannot permanently store the result, so be it. */
- if (__builtin_expect (db->negtimeout == 0, 0))
+ /* If we have a transient error or cannot permanently store
+ the result, so be it. */
+ if (errval == EAGAIN || __builtin_expect (db->negtimeout == 0, 0))
{
/* Mark the old entry as obsolete. */
if (dh != NULL)
diff --git a/libc/nscd/initgrcache.c b/libc/nscd/initgrcache.c
index 4ac9942ae..2019991d2 100644
--- a/libc/nscd/initgrcache.c
+++ b/libc/nscd/initgrcache.c
@@ -1,5 +1,5 @@
/* Cache handling for host lookup.
- Copyright (C) 2004-2006, 2008, 2009, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2004-2006, 2008, 2009, 2011, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2004.
@@ -202,8 +202,9 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req,
written = TEMP_FAILURE_RETRY (send (fd, &notfound, total,
MSG_NOSIGNAL));
- /* If we cannot permanently store the result, so be it. */
- if (__builtin_expect (db->negtimeout == 0, 0))
+ /* If we have a transient error or cannot permanently store
+ the result, so be it. */
+ if (all_tryagain || __builtin_expect (db->negtimeout == 0, 0))
{
/* Mark the old entry as obsolete. */
if (dh != NULL)
diff --git a/libc/nscd/mem.c b/libc/nscd/mem.c
index fcea6dbd0..8ba2ef6f8 100644
--- a/libc/nscd/mem.c
+++ b/libc/nscd/mem.c
@@ -1,5 +1,5 @@
/* Cache memory handling.
- Copyright (C) 2004, 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2004-2006, 2008, 2009, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2004.
@@ -35,11 +35,6 @@
#include "nscd.h"
-/* Wrapper functions with error checking for standard functions. */
-extern void *xmalloc (size_t n);
-extern void *xcalloc (size_t n, size_t s);
-
-
static int
sort_he (const void *p1, const void *p2)
{
diff --git a/libc/nscd/nscd.h b/libc/nscd/nscd.h
index fdaf01bfb..9ac4379b8 100644
--- a/libc/nscd/nscd.h
+++ b/libc/nscd/nscd.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 1998-2001, 2003-2009, 2011 Free Software Foundation, Inc.
+/* Copyright (c) 1998-2001, 2003-2009, 2011, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@suse.de>, 1998.
@@ -201,9 +201,12 @@ extern gid_t old_gid;
/* Prototypes for global functions. */
/* Wrapper functions with error checking for standard functions. */
-extern void *xmalloc (size_t n);
-extern void *xcalloc (size_t n, size_t s);
-extern void *xrealloc (void *o, size_t n);
+extern void *xmalloc (size_t n)
+ __attribute_malloc__ __attribute_alloc_size (1);
+extern void *xcalloc (size_t n, size_t s)
+ __attribute_malloc__ __attribute_alloc_size (1, 2);
+extern void *xrealloc (void *o, size_t n)
+ __attribute_malloc__ __attribute_alloc_size (2);
/* nscd.c */
extern void termination_handler (int signum) __attribute__ ((__noreturn__));
diff --git a/libc/nscd/pwdcache.c b/libc/nscd/pwdcache.c
index 49e130c1f..e2ba09df4 100644
--- a/libc/nscd/pwdcache.c
+++ b/libc/nscd/pwdcache.c
@@ -1,5 +1,5 @@
/* Cache handling for passwd lookup.
- Copyright (C) 1998-2008, 2009, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1998-2008, 2009, 2011, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -124,8 +124,9 @@ cache_addpw (struct database_dyn *db, int fd, request_header *req,
written = TEMP_FAILURE_RETRY (send (fd, &notfound, total,
MSG_NOSIGNAL));
- /* If we cannot permanently store the result, so be it. */
- if (__builtin_expect (db->negtimeout == 0, 0))
+ /* If we have a transient error or cannot permanently store
+ the result, so be it. */
+ if (errno == EAGAIN || __builtin_expect (db->negtimeout == 0, 0))
{
/* Mark the old entry as obsolete. */
if (dh != NULL)
diff --git a/libc/nscd/servicescache.c b/libc/nscd/servicescache.c
index d3d5dce44..a6337e3b0 100644
--- a/libc/nscd/servicescache.c
+++ b/libc/nscd/servicescache.c
@@ -1,5 +1,5 @@
/* Cache handling for services lookup.
- Copyright (C) 2007, 2008, 2009, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2008, 2009, 2011, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@drepper.com>, 2007.
@@ -108,8 +108,9 @@ cache_addserv (struct database_dyn *db, int fd, request_header *req,
written = TEMP_FAILURE_RETRY (send (fd, &notfound, total,
MSG_NOSIGNAL));
- /* If we cannot permanently store the result, so be it. */
- if (__builtin_expect (db->negtimeout == 0, 0))
+ /* If we have a transient error or cannot permanently store
+ the result, so be it. */
+ if (errval == EAGAIN || __builtin_expect (db->negtimeout == 0, 0))
{
/* Mark the old entry as obsolete. */
if (dh != NULL)