summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-07-28 18:26:47 +0000
committerJeremy Allison <jra@samba.org>1998-07-28 18:26:47 +0000
commit83951dd37685ac8c5e45f44270d932250f785be5 (patch)
tree91587db7ad14790aa76827433e100342ad2115db /source3
parent7abcd0521e36425bf7c3dc90929c00ed49e9ab07 (diff)
downloadsamba-83951dd37685ac8c5e45f44270d932250f785be5.tar.gz
samba-83951dd37685ac8c5e45f44270d932250f785be5.tar.bz2
samba-83951dd37685ac8c5e45f44270d932250f785be5.zip
locking.c: Don't need to do map_lock_type on *testing* a lock, just on setting.
Jeremy. (This used to be commit 17f68cc86cafbb04dbd9cc6ecc0aac7b911c9b70)
Diffstat (limited to 'source3')
-rw-r--r--source3/locking/locking.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index 6aecfed6a5..f443482544 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));
}