libctdb: fix writerecord() to actually write the record.
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 21 Jun 2010 05:15:37 +0000 (14:45 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 21 Jun 2010 05:15:37 +0000 (14:45 +0930)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
libctdb/local_tdb.c

index 9a19df7c08bd073b57474a0d69b45fe581d8d457..705be2b548fb9a636cde77133414ec9e4689a02b 100644 (file)
@@ -89,6 +89,8 @@ int ctdb_local_store(struct tdb_context *tdb, TDB_DATA key,
                errno = ENOMEM;
                return -1;
        }
+       memcpy(rec.dptr, header, sizeof(*header));
+       memcpy(rec.dptr + sizeof(*header), data.dptr, data.dsize);
 
        ret = tdb_store(tdb, key, rec, TDB_REPLACE);
        free(old.dptr);