summaryrefslogtreecommitdiff
path: root/source4/lib/tdb/common
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-09-24 06:49:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:38:50 -0500
commit3bcfc68e0d158b272e0ef87bf585f79a570136ba (patch)
treec91cf774feb452fc822983ed35e40f1e3720f1be /source4/lib/tdb/common
parent6e4ebbed8928d618f56c06bfc0802891c3d939ab (diff)
downloadsamba-3bcfc68e0d158b272e0ef87bf585f79a570136ba.tar.gz
samba-3bcfc68e0d158b272e0ef87bf585f79a570136ba.tar.bz2
samba-3bcfc68e0d158b272e0ef87bf585f79a570136ba.zip
r10468: - terminate tdbtorture quickly when an error is detected
- more workarounds for aix not handling malloc of size 0 (This used to be commit c2b1739c6389503854f55fa8407c55071781eff4)
Diffstat (limited to 'source4/lib/tdb/common')
-rw-r--r--source4/lib/tdb/common/io.c4
-rw-r--r--source4/lib/tdb/common/transaction.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/source4/lib/tdb/common/io.c b/source4/lib/tdb/common/io.c
index e9d4e87ac8..355f76962f 100644
--- a/source4/lib/tdb/common/io.c
+++ b/source4/lib/tdb/common/io.c
@@ -97,6 +97,10 @@ static int tdb_oob(struct tdb_context *tdb, tdb_off_t len, int probe)
static int tdb_write(struct tdb_context *tdb, tdb_off_t off,
const void *buf, tdb_len_t len)
{
+ if (len == 0) {
+ return 0;
+ }
+
if (tdb->read_only || tdb->traverse_read) {
tdb->ecode = TDB_ERR_RDONLY;
return -1;
diff --git a/source4/lib/tdb/common/transaction.c b/source4/lib/tdb/common/transaction.c
index a01f8307e9..73c0587a40 100644
--- a/source4/lib/tdb/common/transaction.c
+++ b/source4/lib/tdb/common/transaction.c
@@ -196,6 +196,10 @@ static int transaction_write(struct tdb_context *tdb, tdb_off_t off,
const void *buf, tdb_len_t len)
{
struct tdb_transaction_el *el;
+
+ if (len == 0) {
+ return 0;
+ }
/* if the write is to a hash head, then update the transaction
hash heads */