summaryrefslogtreecommitdiff
path: root/nscd/pwdcache.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-05-15 07:57:49 +0000
committerJakub Jelinek <jakub@redhat.com>2008-05-15 07:57:49 +0000
commit78463734c14d180e4d8e16c6e66fb213fc3479c0 (patch)
tree718b7357ea9e63d4a951a0a725105619b97d2977 /nscd/pwdcache.c
parentef73dbc1301bc42c132d15ae6ca866233c0beeb4 (diff)
Updated to fedora-glibc-20080515T0735cvs/fedora-glibc-2_8_90-1
Diffstat (limited to 'nscd/pwdcache.c')
-rw-r--r--nscd/pwdcache.c29
1 files changed, 6 insertions, 23 deletions
diff --git a/nscd/pwdcache.c b/nscd/pwdcache.c
index 3d1e8241ec..2d0a26592c 100644
--- a/nscd/pwdcache.c
+++ b/nscd/pwdcache.c
@@ -1,5 +1,5 @@
/* Cache handling for passwd lookup.
- Copyright (C) 1998-2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1998-2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -153,11 +153,8 @@ cache_addpw (struct database_dyn *db, int fd, request_header *req,
/* Now get the lock to safely insert the records. */
pthread_rwlock_rdlock (&db->lock);
- if (cache_add (req->type, key_copy, req->key_len,
- &dataset->head, true, db, owner) < 0)
- /* Ensure the data can be recovered. */
- dataset->head.usable = false;
-
+ (void) cache_add (req->type, key_copy, req->key_len,
+ &dataset->head, true, db, owner);
pthread_rwlock_unlock (&db->lock);
@@ -352,12 +349,7 @@ cache_addpw (struct database_dyn *db, int fd, request_header *req,
{
if (cache_add (GETPWBYUID, cp, key_offset, &dataset->head, true,
db, owner) < 0)
- {
- /* Could not allocate memory. Make sure the data gets
- discarded. */
- dataset->head.usable = false;
- goto out;
- }
+ goto out;
first = false;
}
@@ -366,12 +358,7 @@ cache_addpw (struct database_dyn *db, int fd, request_header *req,
{
if (cache_add (GETPWBYNAME, key_copy, key_len + 1,
&dataset->head, true, db, owner) < 0)
- {
- /* Could not allocate memory. Make sure the data gets
- discarded. */
- dataset->head.usable = false;
- goto out;
- }
+ goto out;
first = false;
}
@@ -384,12 +371,8 @@ cache_addpw (struct database_dyn *db, int fd, request_header *req,
{
if (req->type == GETPWBYNAME && db->propagate)
(void) cache_add (GETPWBYUID, cp, key_offset, &dataset->head,
- req->type != GETPWBYNAME, db, owner);
+ false, db, owner);
}
- else if (first)
- /* Could not allocate memory. Make sure the data gets
- discarded. */
- dataset->head.usable = false;
out:
pthread_rwlock_unlock (&db->lock);