mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-18 11:05:48 +08:00
ITS#8319 mdb_load: explain readline and mdb_cursor_put errors
This commit is contained in:
parent
b0851a13af
commit
8297bfe028
@ -400,20 +400,22 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
rc = readline(&key, &kbuf);
|
rc = readline(&key, &kbuf);
|
||||||
if (rc == EOF)
|
if (rc) /* rc == EOF */
|
||||||
break;
|
break;
|
||||||
if (rc)
|
|
||||||
goto txn_abort;
|
|
||||||
|
|
||||||
rc = readline(&data, &dbuf);
|
rc = readline(&data, &dbuf);
|
||||||
if (rc)
|
if (rc) {
|
||||||
|
fprintf(stderr, "%s: line %" Z "d: failed to read key value\n", prog, lineno);
|
||||||
goto txn_abort;
|
goto txn_abort;
|
||||||
|
}
|
||||||
|
|
||||||
rc = mdb_cursor_put(mc, &key, &data, putflags);
|
rc = mdb_cursor_put(mc, &key, &data, putflags);
|
||||||
if (rc == MDB_KEYEXIST && putflags)
|
if (rc == MDB_KEYEXIST && putflags)
|
||||||
continue;
|
continue;
|
||||||
if (rc)
|
if (rc) {
|
||||||
|
fprintf(stderr, "mdb_cursor_put failed, error %d %s\n", rc, mdb_strerror(rc));
|
||||||
goto txn_abort;
|
goto txn_abort;
|
||||||
|
}
|
||||||
batch++;
|
batch++;
|
||||||
if (batch == 100) {
|
if (batch == 100) {
|
||||||
rc = mdb_txn_commit(txn);
|
rc = mdb_txn_commit(txn);
|
||||||
|
Loading…
Reference in New Issue
Block a user