You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by sf...@apache.org on 2015/08/20 13:30:52 UTC

svn commit: r1696767 - /apr/apr/trunk/file_io/unix/flock.c

Author: sf
Date: Thu Aug 20 11:30:52 2015
New Revision: 1696767

URL: http://svn.apache.org/r1696767
Log:
Fix comments for fcntl lock

apr_file_lock() should lock the whole file. The code uses SEEK_SET which
means 'start of file' and is correct, but the comments describe the SEEK_CUR
behavior.

Fix comments.

Modified:
    apr/apr/trunk/file_io/unix/flock.c

Modified: apr/apr/trunk/file_io/unix/flock.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/file_io/unix/flock.c?rev=1696767&r1=1696766&r2=1696767&view=diff
==============================================================================
--- apr/apr/trunk/file_io/unix/flock.c (original)
+++ apr/apr/trunk/file_io/unix/flock.c Thu Aug 20 11:30:52 2015
@@ -32,8 +32,8 @@ APR_DECLARE(apr_status_t) apr_file_lock(
         struct flock l = { 0 };
         int fc;
 
-        l.l_whence = SEEK_SET;  /* lock from current point */
-        l.l_start = 0;          /* begin lock at this offset */
+        l.l_whence = SEEK_SET;  /* count l_start from start of file */
+        l.l_start = 0;          /* lock from start of file */
         l.l_len = 0;            /* lock to end of file */
         if ((type & APR_FLOCK_TYPEMASK) == APR_FLOCK_SHARED)
             l.l_type = F_RDLCK;
@@ -90,8 +90,8 @@ APR_DECLARE(apr_status_t) apr_file_unloc
     {
         struct flock l = { 0 };
 
-        l.l_whence = SEEK_SET;  /* lock from current point */
-        l.l_start = 0;          /* begin lock at this offset */
+        l.l_whence = SEEK_SET;  /* count l_start from start of file */
+        l.l_start = 0;          /* lock from start of file */
         l.l_len = 0;            /* lock to end of file */
         l.l_type = F_UNLCK;