summaryrefslogtreecommitdiff
path: root/source3/lib/eventlog
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-06-20 18:40:31 +0930
committerRusty Russell <rusty@rustcorp.com.au>2011-06-20 11:18:35 +0200
commit6bc59d77b64d1ecbe5c906ed2fa80a7b8ca5d420 (patch)
tree616215df22728c5e4e95cf20f80ff62051274531 /source3/lib/eventlog
parent1078eb21c49d707ddeef2257353f35c10d131b9f (diff)
downloadsamba-6bc59d77b64d1ecbe5c906ed2fa80a7b8ca5d420.tar.gz
samba-6bc59d77b64d1ecbe5c906ed2fa80a7b8ca5d420.tar.bz2
samba-6bc59d77b64d1ecbe5c906ed2fa80a7b8ca5d420.zip
tdb_store: check returns for 0, not -1.
TDB2 returns a negative error number on failure. This is compatible if we always check for != 0 instead of == -1. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'source3/lib/eventlog')
-rw-r--r--source3/lib/eventlog/eventlog.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/lib/eventlog/eventlog.c b/source3/lib/eventlog/eventlog.c
index b719c6f7f8..c29c6f0ed4 100644
--- a/source3/lib/eventlog/eventlog.c
+++ b/source3/lib/eventlog/eventlog.c
@@ -804,13 +804,13 @@ NTSTATUS evlog_push_record_tdb(TALLOC_CTX *mem_ctx,
ebuf.dptr = blob.data;
ret = tdb_store(tdb, kbuf, ebuf, 0);
- if (ret == -1) {
+ if (ret != 0) {
tdb_unlock_bystring(tdb, EVT_NEXT_RECORD);
return NT_STATUS_EVENTLOG_FILE_CORRUPT;
}
ret = tdb_store_int32(tdb, EVT_NEXT_RECORD, r->record_number + 1);
- if (ret == -1) {
+ if (ret != 0) {
tdb_unlock_bystring(tdb, EVT_NEXT_RECORD);
return NT_STATUS_EVENTLOG_FILE_CORRUPT;
}