]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/tdb.c
tdb2: add full LGPL headers
[ccan] / ccan / tdb2 / tdb.c
index d7b5163be95eba66ac204f1be75dc239350c41f9..a2d36b373c4b7d875aeb45e477366a2ae3371972 100644 (file)
@@ -1,3 +1,20 @@
+ /*
+   Trivial Database 2: fetch, store and misc routines.
+   Copyright (C) Rusty Russell 2010
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
 #include "private.h"
 #include <ccan/asprintf/asprintf.h>
 #include <stdarg.h>
@@ -42,7 +59,7 @@ static enum TDB_ERROR replace_data(struct tdb_context *tdb,
                ecode = add_free_record(tdb, old_off,
                                        sizeof(struct tdb_used_record)
                                        + key.dsize + old_room,
-                                       TDB_LOCK_WAIT);
+                                       TDB_LOCK_WAIT, true);
                if (ecode == TDB_SUCCESS)
                        ecode = replace_in_hash(tdb, h, new_off);
        } else {
@@ -292,7 +309,7 @@ enum TDB_ERROR tdb_delete(struct tdb_context *tdb, struct tdb_data key)
                                + rec_key_length(&rec)
                                + rec_data_length(&rec)
                                + rec_extra_padding(&rec),
-                               TDB_LOCK_WAIT);
+                               TDB_LOCK_WAIT, true);
 
        if (tdb->flags & TDB_SEQNUM)
                tdb_inc_seqnum(tdb);