]> git.sur5r.net Git - openldap/commitdiff
Import ITS#2924 fix from HEAD
authorHoward Chu <hyc@openldap.org>
Sat, 17 Jan 2004 17:50:57 +0000 (17:50 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 17 Jan 2004 17:50:57 +0000 (17:50 +0000)
servers/slapd/backglue.c

index a07374ba285add9cc60db617e6a263020106c10f..63fe87d0b151117fe42caaaf2f75f67d58b7f6ac 100644 (file)
@@ -488,7 +488,8 @@ glue_tool_entry_first (
                }
 
        }
-       if (!glueBack || glueBack->be_entry_open (glueBack, glueMode) != 0)
+       if (!glueBack || !glueBack->be_entry_open || !glueBack->be_entry_first
+               || glueBack->be_entry_open (glueBack, glueMode) != 0)
                return NOID;
 
        return glueBack->be_entry_first (glueBack);
@@ -509,7 +510,7 @@ glue_tool_entry_next (
        rc = glueBack->be_entry_next (glueBack);
 
        /* If we ran out of entries in one database, move on to the next */
-       if (rc == NOID) {
+       while (rc == NOID) {
                glueBack->be_entry_close (glueBack);
                for (i=0; i<gi->nodes; i++) {
                        if (gi->n[i].be == glueBack)
@@ -517,7 +518,7 @@ glue_tool_entry_next (
                }
                if (i == 0) {
                        glueBack = NULL;
-                       rc = NOID;
+                       break;
                } else {
                        glueBack = gi->n[i-1].be;
                        rc = glue_tool_entry_first (b0);