diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-09-06 01:19:35 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-09-06 01:19:35 +0000 |
commit | 9ef7a6c7865c14480139188c30744914c5b7af43 (patch) | |
tree | 61be92b85a5b9eb70fcfe426c5c6e3ddaaae4ce1 /source3/locking/locking.c | |
parent | 851e60c3825c6d3398973b20374feb1806a22238 (diff) | |
download | samba-9ef7a6c7865c14480139188c30744914c5b7af43.tar.gz samba-9ef7a6c7865c14480139188c30744914c5b7af43.tar.bz2 samba-9ef7a6c7865c14480139188c30744914c5b7af43.zip |
use NTSTATUS not BOOL in do_lock()
(This used to be commit b1b2a5fa5d084dad8ae47777419ab75db1e51eff)
Diffstat (limited to 'source3/locking/locking.c')
-rw-r--r-- | source3/locking/locking.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c index d2bfc08dd3..a1e4ba6d6c 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -102,7 +102,7 @@ BOOL is_locked(files_struct *fsp,connection_struct *conn, NTSTATUS do_lock(files_struct *fsp,connection_struct *conn, uint16 lock_pid, SMB_BIG_UINT count,SMB_BIG_UINT offset,enum brl_type lock_type) { - BOOL ok = False; + NTSTATUS status; if (!lp_locking(SNUM(conn))) return NT_STATUS_OK; @@ -114,12 +114,12 @@ NTSTATUS do_lock(files_struct *fsp,connection_struct *conn, uint16 lock_pid, lock_type_name(lock_type), (double)offset, (double)count, fsp->fsp_name )); if (OPEN_FSP(fsp) && fsp->can_lock && (fsp->conn == conn)) { - ok = brl_lock(fsp->dev, fsp->inode, fsp->fnum, - lock_pid, sys_getpid(), conn->cnum, - offset, count, - lock_type); + status = brl_lock(fsp->dev, fsp->inode, fsp->fnum, + lock_pid, sys_getpid(), conn->cnum, + offset, count, + lock_type); - if (ok && lp_posix_locking(SNUM(conn))) { + if (NT_STATUS_IS_OK(status) && lp_posix_locking(SNUM(conn))) { /* * Try and get a POSIX lock on this range. @@ -127,9 +127,8 @@ NTSTATUS do_lock(files_struct *fsp,connection_struct *conn, uint16 lock_pid, * overlapping on a different fd. JRA. */ - ok = set_posix_lock(fsp, offset, count, lock_type); - - if (!ok) { + if (!set_posix_lock(fsp, offset, count, lock_type)) { + status = NT_STATUS_LOCK_NOT_GRANTED; /* * We failed to map - we must now remove the brl * lock entry. @@ -141,9 +140,7 @@ NTSTATUS do_lock(files_struct *fsp,connection_struct *conn, uint16 lock_pid, } } - if (!ok) return NT_STATUS_FILE_LOCK_CONFLICT; - - return NT_STATUS_OK; /* Got lock */ + return status; } /**************************************************************************** |