diff options
author | sf <sf@13f79535-47bb-0310-9956-ffa450edef68> | 2015-08-20 11:33:06 +0000 |
---|---|---|
committer | sf <sf@13f79535-47bb-0310-9956-ffa450edef68> | 2015-08-20 11:33:06 +0000 |
commit | 794406d40f0bdc5a68a93805e567ed51f1ea177a (patch) | |
tree | c64e8c92a5a4bdf86c29b1266ddae48b4cc0cd34 | |
parent | 42a0f703ecf6d543057965ead6d79527662e1065 (diff) | |
download | libapr-794406d40f0bdc5a68a93805e567ed51f1ea177a.tar.gz |
Merge r1696767 from trunk:
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.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1696770 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | file_io/unix/flock.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/file_io/unix/flock.c b/file_io/unix/flock.c index f400a9670..01e8a639b 100644 --- a/file_io/unix/flock.c +++ b/file_io/unix/flock.c @@ -32,8 +32,8 @@ APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type) 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_unlock(apr_file_t *thefile) { 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; |