SHA256
1
0
forked from pool/glibc
glibc/glibc-2.3.5-nscd-zeronegtimeout.diff
OBS User autobuild 35b77f97b8 Accepting request 24314 from Base:System
Copy from Base:System/glibc based on submit request 24314 from user pbaudis

OBS-URL: https://build.opensuse.org/request/show/24314
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/glibc?expand=0&rev=13
2009-11-16 08:54:19 +00:00

111 lines
3.9 KiB
Diff

Index: nscd/aicache.c
===================================================================
--- nscd/aicache.c.orig
+++ nscd/aicache.c
@@ -504,9 +504,15 @@ next_nip:
if (fd != -1)
TEMP_FAILURE_RETRY (send (fd, &notfound, total, MSG_NOSIGNAL));
- dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len, 1);
/* If we cannot permanently store the result, so be it. */
- if (dataset != NULL)
+ if (db->negtimeout == 0)
+ {
+ /* Mark the old entry as obsolete. */
+ if (dh != NULL)
+ dh->usable = false;
+ dataset = NULL;
+ }
+ else if ((dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len, 1)) != NULL)
{
dataset->head.allocsize = sizeof (struct dataset) + req->key_len;
dataset->head.recsize = total;
Index: nscd/grpcache.c
===================================================================
--- nscd/grpcache.c.orig
+++ nscd/grpcache.c
@@ -113,10 +113,14 @@ cache_addgr (struct database_dyn *db, in
written = TEMP_FAILURE_RETRY (send (fd, &notfound, total,
MSG_NOSIGNAL));
- dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len,
- 1);
/* If we cannot permanently store the result, so be it. */
- if (dataset != NULL)
+ if (db->negtimeout == 0)
+ {
+ /* Mark the old entry as obsolete. */
+ if (dh != NULL)
+ dh->usable = false;
+ }
+ else if ((dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len, 1)) != NULL)
{
dataset->head.allocsize = sizeof (struct dataset) + req->key_len;
dataset->head.recsize = total;
Index: nscd/hstcache.c
===================================================================
--- nscd/hstcache.c.orig
+++ nscd/hstcache.c
@@ -119,10 +119,14 @@ cache_addhst (struct database_dyn *db, i
MSG_NOSIGNAL)) != total)
all_written = false;
- dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len,
- 1);
/* If we cannot permanently store the result, so be it. */
- if (dataset != NULL)
+ if (db->negtimeout == 0)
+ {
+ /* Mark the old entry as obsolete. */
+ if (dh != NULL)
+ dh->usable = false;
+ }
+ else if ((dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len, 1)) != NULL)
{
dataset->head.allocsize = sizeof (struct dataset) + req->key_len;
dataset->head.recsize = total;
Index: nscd/initgrcache.c
===================================================================
--- nscd/initgrcache.c.orig
+++ nscd/initgrcache.c
@@ -197,10 +197,14 @@ addinitgroupsX (struct database_dyn *db,
written = TEMP_FAILURE_RETRY (send (fd, &notfound, total,
MSG_NOSIGNAL));
- dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len,
- 1);
/* If we cannot permanently store the result, so be it. */
- if (dataset != NULL)
+ if (db->negtimeout == 0)
+ {
+ /* Mark the old entry as obsolete. */
+ if (dh != NULL)
+ dh->usable = false;
+ }
+ else if ((dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len, 1)) != NULL)
{
dataset->head.allocsize = sizeof (struct dataset) + req->key_len;
dataset->head.recsize = total;
Index: nscd/pwdcache.c
===================================================================
--- nscd/pwdcache.c.orig
+++ nscd/pwdcache.c
@@ -120,10 +120,14 @@ cache_addpw (struct database_dyn *db, in
written = TEMP_FAILURE_RETRY (send (fd, &notfound, total,
MSG_NOSIGNAL));
- dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len,
- 1);
/* If we cannot permanently store the result, so be it. */
- if (dataset != NULL)
+ if (db->negtimeout == 0)
+ {
+ /* Mark the old entry as obsolete. */
+ if (dh != NULL)
+ dh->usable = false;
+ }
+ else if ((dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len, 1)) != NULL)
{
dataset->head.allocsize = sizeof (struct dataset) + req->key_len;
dataset->head.recsize = total;