summaryrefslogtreecommitdiff
path: root/source3/locking/posix.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-03-25 01:35:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:15:44 -0500
commit7f57dc61cbf2f421ad9af82164ca0e03c72c5949 (patch)
tree55e1794727bd1c3996f23960a3c930d08da36a2d /source3/locking/posix.c
parentefd32bf37183c5c797cec0da37cd347a4a1bfbb2 (diff)
downloadsamba-7f57dc61cbf2f421ad9af82164ca0e03c72c5949.tar.gz
samba-7f57dc61cbf2f421ad9af82164ca0e03c72c5949.tar.bz2
samba-7f57dc61cbf2f421ad9af82164ca0e03c72c5949.zip
r14703: Clarify the return codes for the POSIX locking case. This
was confusing. Jeremy. (This used to be commit bc1a605a39e58a7dbdcd4d132345e957e3ed9d5e)
Diffstat (limited to 'source3/locking/posix.c')
-rw-r--r--source3/locking/posix.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source3/locking/posix.c b/source3/locking/posix.c
index 4b69047a3c..07246474f3 100644
--- a/source3/locking/posix.c
+++ b/source3/locking/posix.c
@@ -644,15 +644,19 @@ static BOOL posix_lock_in_range(SMB_OFF_T *offset_out, SMB_OFF_T *count_out,
/****************************************************************************
Actual function that does POSIX locks. Copes with 64 -> 32 bit cruft and
- broken NFS implementations.
+ broken NFS implementations. Returns True if we got the lock or the region
+ is unlocked in the F_GETLK case, False otherwise.
****************************************************************************/
static BOOL posix_fcntl_lock(files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
{
- int ret;
+ BOOL ret;
DEBUG(8,("posix_fcntl_lock %d %d %.0f %.0f %d\n",fsp->fh->fd,op,(double)offset,(double)count,type));
+ /* In the F_GETLK case this returns True if the region
+ was locked, False if unlocked. */
+
ret = SMB_VFS_LOCK(fsp,fsp->fh->fd,op,offset,count,type);
if (!ret && ((errno == EFBIG) || (errno == ENOLCK) || (errno == EINVAL))) {