radareorg / sdb

Simple and fast string based key-value database with support for arrays and json
https://www.radare.org/
MIT License
217 stars 62 forks source link

sdb fails to sync from mem to file #140

Open jroimartin opened 7 years ago

jroimartin commented 7 years ago

During the implementation of the command zos in r2 (save zigns), it's been found that syncing from mem to file was buggy. Current workaround:

    Sdb *db = sdb_new (NULL, file, 0);
    if (!db) {
        return false;
    }
    sdb_merge (db, a->sdb_zigns);
    retval = sdb_sync (db);
    sdb_close (db);
    sdb_free (db);
radare commented 7 years ago

Can u add a unit test for this?

On 1 Jun 2017, at 18:53, Roi Martin notifications@github.com wrote:

During the implementation of the command zos in r2 (save zigns), it's been found that syncing from mem to file was buggy. Current workaround:

Sdb *db = sdb_new (NULL, file, 0);
if (!db) {
    return false;
}
sdb_merge (db, a->sdb_zigns);
retval = sdb_sync (db);
sdb_close (db);
sdb_free (db);

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.