1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

s3:locking:posix: adapt use of dbrwrap_fetch() to new NTSTATUS semantics

This commit is contained in:
Michael Adam 2011-11-10 22:55:28 +01:00
parent 3a2fd7c0e2
commit 95e686d59c

View File

@ -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);
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);
if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) {
goto done;
}
SMB_ASSERT(NT_STATUS_IS_OK(status));
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) {