diff options
-rw-r--r-- | source3/lib/messages_local.c | 4 | ||||
-rw-r--r-- | source3/lib/util_tdb.c | 2 | ||||
-rw-r--r-- | source3/libsmb/smb_share_modes.c | 2 | ||||
-rw-r--r-- | source3/printing/printing.c | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/source3/lib/messages_local.c b/source3/lib/messages_local.c index d7f370c9e4..455f3d3476 100644 --- a/source3/lib/messages_local.c +++ b/source3/lib/messages_local.c @@ -352,7 +352,7 @@ static NTSTATUS messaging_tdb_send(struct messaging_context *msg_ctx, key = message_key_pid(frame, pid); - if (tdb_chainlock(tdb->tdb, key) == -1) { + if (tdb_chainlock(tdb->tdb, key) != 0) { TALLOC_FREE(frame); return NT_STATUS_LOCK_NOT_GRANTED; } @@ -420,7 +420,7 @@ static NTSTATUS retrieve_all_messages(TDB_CONTEXT *msg_tdb, TDB_DATA key = message_key_pid(mem_ctx, id); NTSTATUS status; - if (tdb_chainlock(msg_tdb, key) == -1) { + if (tdb_chainlock(msg_tdb, key) != 0) { TALLOC_FREE(key.dptr); return NT_STATUS_LOCK_NOT_GRANTED; } diff --git a/source3/lib/util_tdb.c b/source3/lib/util_tdb.c index f0fc8cd29b..e78dbec704 100644 --- a/source3/lib/util_tdb.c +++ b/source3/lib/util_tdb.c @@ -78,7 +78,7 @@ static int tdb_chainlock_with_timeout_internal( TDB_CONTEXT *tdb, TDB_DATA key, } } - return ret; + return ret == 0 ? 0 : -1; } /**************************************************************************** diff --git a/source3/libsmb/smb_share_modes.c b/source3/libsmb/smb_share_modes.c index e891b960d8..86e1a81ef1 100644 --- a/source3/libsmb/smb_share_modes.c +++ b/source3/libsmb/smb_share_modes.c @@ -122,7 +122,7 @@ int smb_lock_share_mode_entry(struct smbdb_ctx *db_ctx, { struct locking_key lk; return tdb_chainlock(db_ctx->smb_tdb, get_locking_key(&lk, dev, ino, - extid)); + extid)) == 0 ? 0 : -1; } int smb_unlock_share_mode_entry(struct smbdb_ctx *db_ctx, diff --git a/source3/printing/printing.c b/source3/printing/printing.c index 6dbb560e43..6503407f82 100644 --- a/source3/printing/printing.c +++ b/source3/printing/printing.c @@ -605,7 +605,7 @@ static bool remove_from_jobs_changed(const char* sharename, uint32_t jobid) key = string_tdb_data("INFO/jobs_changed"); - if (tdb_chainlock_with_timeout(pdb->tdb, key, 5) == -1) + if (tdb_chainlock_with_timeout(pdb->tdb, key, 5) != 0) goto out; gotlock = True; |