1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

locking.c: Don't need to do map_lock_type on *testing* a lock, just on setting.

Jeremy.
(This used to be commit 17f68cc86c)
This commit is contained in:
Jeremy Allison 1998-07-28 18:26:47 +00:00
parent 7abcd0521e
commit 83951dd376

View File

@ -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));
}