diff options
Diffstat (limited to 'libc/nscd/aicache.c')
-rw-r--r-- | libc/nscd/aicache.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libc/nscd/aicache.c b/libc/nscd/aicache.c index 68706a4cf..a69a7781d 100644 --- a/libc/nscd/aicache.c +++ b/libc/nscd/aicache.c @@ -157,7 +157,7 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req, tmpbuf4 = tmpbuf6; } - /* Next collect IPv4 information first. */ + /* Next collect IPv4 information. */ while (1) { rc4 = 0; @@ -170,7 +170,7 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req, tmpbuf4 = extend_alloca (tmpbuf4, tmpbuf4len, 2 * tmpbuf4len); } - if (rc4 != 0 || herrno == NETDB_INTERNAL) + if (rc4 != 0 && herrno == NETDB_INTERNAL) goto out; if (status[0] == NSS_STATUS_SUCCESS @@ -339,7 +339,7 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req, = (struct dataset *) mempool_alloc (db, total + req->key_len); - if (newp != NULL) + if (__builtin_expect (newp != NULL, 1)) { /* Adjust pointer into the memory block. */ key_copy = (char *) newp + (key_copy @@ -349,6 +349,8 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req, total + req->key_len); alloca_used = false; } + else + ++db->head->addfailed; /* Mark the old record as obsolete. */ dh->usable = false; |