summaryrefslogtreecommitdiff
path: root/source3/locking
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2011-11-10 22:55:28 +0100
committerMichael Adam <obnox@samba.org>2011-11-25 13:24:34 +0100
commit95e686d59c2e712b4e030c770a37dde18837e222 (patch)
tree846b750108f8439ab445247e6805367f3baaba3f /source3/locking
parent3a2fd7c0e213e0fefed40eaa31a2282b126f2be4 (diff)
downloadsamba-95e686d59c2e712b4e030c770a37dde18837e222.tar.gz
samba-95e686d59c2e712b4e030c770a37dde18837e222.tar.bz2
samba-95e686d59c2e712b4e030c770a37dde18837e222.zip
s3:locking:posix: adapt use of dbrwrap_fetch() to new NTSTATUS semantics
Diffstat (limited to 'source3/locking')
-rw-r--r--source3/locking/posix.c19
1 files changed, 14 insertions, 5 deletions
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) {