From 83951dd37685ac8c5e45f44270d932250f785be5 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 28 Jul 1998 18:26:47 +0000 Subject: [PATCH] locking.c: Don't need to do map_lock_type on *testing* a lock, just on setting. Jeremy. (This used to be commit 17f68cc86cafbb04dbd9cc6ecc0aac7b911c9b70) --- source3/locking/locking.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source3/locking/locking.c b/source3/locking/locking.c index 6aecfed6a52..f443482544c 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -82,8 +82,13 @@ BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset, int lock_type) if (!lp_locking(snum) || !lp_strict_locking(snum)) return(False); - return(fcntl_lock(fsp->fd_ptr->fd,F_GETLK,offset,count, - map_lock_type(fsp,lock_type))); + /* + * Note that most UNIX's can *test* for a write lock on + * a read-only fd, just not *set* a write lock on a read-only + * fd. So we don't need to use map_lock_type here. + */ + + return(fcntl_lock(fsp->fd_ptr->fd,F_GETLK,offset,count,lock_type)); }