rc = mdb_env_open(env, envname, envflags | MDB_RDONLY, 0664);
if (rc) {
- printf("mdb_env_open failed, error %d %s\n", rc, mdb_strerror(rc));
+ fprintf(stderr, "mdb_env_open failed, error %d %s\n", rc, mdb_strerror(rc));
goto env_close;
}
rc = mdb_txn_begin(env, NULL, MDB_RDONLY, &txn);
if (rc) {
- printf("mdb_txn_begin failed, error %d %s\n", rc, mdb_strerror(rc));
+ fprintf(stderr, "mdb_txn_begin failed, error %d %s\n", rc, mdb_strerror(rc));
goto env_close;
}
rc = mdb_open(txn, subname, 0, &dbi);
if (rc) {
- printf("mdb_open failed, error %d %s\n", rc, mdb_strerror(rc));
+ fprintf(stderr, "mdb_open failed, error %d %s\n", rc, mdb_strerror(rc));
goto txn_abort;
}
rc = mdb_cursor_open(txn, dbi, &cursor);
if (rc) {
- printf("mdb_cursor_open failed, error %d %s\n", rc, mdb_strerror(rc));
+ fprintf(stderr, "mdb_cursor_open failed, error %d %s\n", rc, mdb_strerror(rc));
goto txn_abort;
}
while ((rc = mdb_cursor_get(cursor, &key, NULL, MDB_NEXT_NODUP)) == 0) {
rc = mdb_env_open(env, envname, envflags, 0664);
if (rc) {
- printf("mdb_env_open failed, error %d %s\n", rc, mdb_strerror(rc));
+ fprintf(stderr, "mdb_env_open failed, error %d %s\n", rc, mdb_strerror(rc));
goto env_close;
}
rc = mdb_txn_begin(env, NULL, 0, &txn);
if (rc) {
- printf("mdb_txn_begin failed, error %d %s\n", rc, mdb_strerror(rc));
+ fprintf(stderr, "mdb_txn_begin failed, error %d %s\n", rc, mdb_strerror(rc));
goto env_close;
}
rc = mdb_open(txn, subname, flags|MDB_CREATE, &dbi);
if (rc) {
- printf("mdb_open failed, error %d %s\n", rc, mdb_strerror(rc));
+ fprintf(stderr, "mdb_open failed, error %d %s\n", rc, mdb_strerror(rc));
goto txn_abort;
}
rc = mdb_cursor_open(txn, dbi, &mc);
if (rc) {
- printf("mdb_cursor_open failed, error %d %s\n", rc, mdb_strerror(rc));
+ fprintf(stderr, "mdb_cursor_open failed, error %d %s\n", rc, mdb_strerror(rc));
goto txn_abort;
}
}
rc = mdb_txn_begin(env, NULL, 0, &txn);
if (rc) {
- printf("mdb_txn_begin failed, error %d %s\n", rc, mdb_strerror(rc));
+ fprintf(stderr, "mdb_txn_begin failed, error %d %s\n", rc, mdb_strerror(rc));
goto env_close;
}
rc = mdb_cursor_open(txn, dbi, &mc);
if (rc) {
- printf("mdb_cursor_open failed, error %d %s\n", rc, mdb_strerror(rc));
+ fprintf(stderr, "mdb_cursor_open failed, error %d %s\n", rc, mdb_strerror(rc));
goto txn_abort;
}
batch = 0;
rc = mdb_env_open(env, envname, envflags | MDB_RDONLY, 0664);
if (rc) {
- printf("mdb_env_open failed, error %d %s\n", rc, mdb_strerror(rc));
+ fprintf(stderr, "mdb_env_open failed, error %d %s\n", rc, mdb_strerror(rc));
goto env_close;
}
rc = mdb_txn_begin(env, NULL, MDB_RDONLY, &txn);
if (rc) {
- printf("mdb_txn_begin failed, error %d %s\n", rc, mdb_strerror(rc));
+ fprintf(stderr, "mdb_txn_begin failed, error %d %s\n", rc, mdb_strerror(rc));
goto env_close;
}
dbi = 0;
rc = mdb_cursor_open(txn, dbi, &cursor);
if (rc) {
- printf("mdb_cursor_open failed, error %d %s\n", rc, mdb_strerror(rc));
+ fprintf(stderr, "mdb_cursor_open failed, error %d %s\n", rc, mdb_strerror(rc));
goto txn_abort;
}
rc = mdb_stat(txn, dbi, &mst);
if (rc) {
- printf("mdb_stat failed, error %d %s\n", rc, mdb_strerror(rc));
+ fprintf(stderr, "mdb_stat failed, error %d %s\n", rc, mdb_strerror(rc));
goto txn_abort;
}
prstat(&mst);
rc = mdb_open(txn, subname, 0, &dbi);
if (rc) {
- printf("mdb_open failed, error %d %s\n", rc, mdb_strerror(rc));
+ fprintf(stderr, "mdb_open failed, error %d %s\n", rc, mdb_strerror(rc));
goto txn_abort;
}
rc = mdb_stat(txn, dbi, &mst);
if (rc) {
- printf("mdb_stat failed, error %d %s\n", rc, mdb_strerror(rc));
+ fprintf(stderr, "mdb_stat failed, error %d %s\n", rc, mdb_strerror(rc));
goto txn_abort;
}
printf("Status of %s\n", subname ? subname : "Main DB");
rc = mdb_cursor_open(txn, dbi, &cursor);
if (rc) {
- printf("mdb_cursor_open failed, error %d %s\n", rc, mdb_strerror(rc));
+ fprintf(stderr, "mdb_cursor_open failed, error %d %s\n", rc, mdb_strerror(rc));
goto txn_abort;
}
while ((rc = mdb_cursor_get(cursor, &key, NULL, MDB_NEXT_NODUP)) == 0) {
if (rc) continue;
rc = mdb_stat(txn, db2, &mst);
if (rc) {
- printf("mdb_stat failed, error %d %s\n", rc, mdb_strerror(rc));
+ fprintf(stderr, "mdb_stat failed, error %d %s\n", rc, mdb_strerror(rc));
goto txn_abort;
}
prstat(&mst);