From 95e686d59c2e712b4e030c770a37dde18837e222 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 10 Nov 2011 22:55:28 +0100 Subject: s3:locking:posix: adapt use of dbrwrap_fetch() to new NTSTATUS semantics --- source3/locking/posix.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'source3/locking') diff --git a/source3/locking/posix.c b/source3/locking/posix.c index a28744a76f..3a8b1635d8 100644 --- a/source3/locking/posix.c +++ b/source3/locking/posix.c @@ -513,14 +513,18 @@ static int get_windows_lock_ref_count(files_struct *fsp) posix_pending_close_db, talloc_tos(), locking_ref_count_key_fsp(fsp, &tmp), &dbuf); + if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) { + goto done; + } + SMB_ASSERT(NT_STATUS_IS_OK(status)); - if (dbuf.dsize != 0) { - SMB_ASSERT(dbuf.dsize == sizeof(lock_ref_count)); - memcpy(&lock_ref_count, dbuf.dptr, sizeof(lock_ref_count)); - TALLOC_FREE(dbuf.dptr); - } + SMB_ASSERT(dbuf.dsize == sizeof(lock_ref_count)); + + memcpy(&lock_ref_count, dbuf.dptr, sizeof(lock_ref_count)); + TALLOC_FREE(dbuf.dptr); +done: DEBUG(10,("get_windows_lock_count for file %s = %d\n", fsp_str_dbg(fsp), lock_ref_count)); @@ -623,6 +627,11 @@ static size_t get_posix_pending_close_entries(TALLOC_CTX *mem_ctx, posix_pending_close_db, mem_ctx, fd_array_key_fsp(fsp), &dbuf); + if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) { + *entries = NULL; + return 0; + } + SMB_ASSERT(NT_STATUS_IS_OK(status)); if (dbuf.dsize == 0) { -- cgit