summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
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));
}