summaryrefslogtreecommitdiff
path: root/lib/tdb2/tdb1_io.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-09-14 08:13:26 +0930
committerRusty Russell <rusty@rustcorp.com.au>2011-09-14 08:13:26 +0930
commitef70f5dd35974115a85850d04b0f4b64e511659f (patch)
tree7904ff676e509cc4feec0887b8034f9c570eaaf1 /lib/tdb2/tdb1_io.c
parent6b11a2630123453a7f40f728641882c440b57010 (diff)
downloadsamba-ef70f5dd35974115a85850d04b0f4b64e511659f.tar.gz
samba-ef70f5dd35974115a85850d04b0f4b64e511659f.tar.bz2
samba-ef70f5dd35974115a85850d04b0f4b64e511659f.zip
tdb2: log allocation failures in tdb1 backend.
The TDB2 tests are stricter about this; they want every error logged. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 670ba98f74b52df541d153eeab9d3310932e75cd)
Diffstat (limited to 'lib/tdb2/tdb1_io.c')
-rw-r--r--lib/tdb2/tdb1_io.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/tdb2/tdb1_io.c b/lib/tdb2/tdb1_io.c
index ba6deeef20..f3d139d043 100644
--- a/lib/tdb2/tdb1_io.c
+++ b/lib/tdb2/tdb1_io.c
@@ -370,6 +370,9 @@ int tdb1_expand(struct tdb_context *tdb, tdb1_off_t size)
char *new_map_ptr = (char *)realloc(tdb->file->map_ptr,
tdb->file->map_size);
if (!new_map_ptr) {
+ tdb->last_error = tdb_logerr(tdb, TDB_ERR_OOM,
+ TDB_LOG_ERROR,
+ "tdb1_expand: no memory");
tdb->file->map_size -= size;
goto fail;
}