summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVikas Gorur <vikas@gluster.com>2009-08-11 04:59:29 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-08-17 14:37:30 -0700
commit53430bbd47dd61544e10596ca490e64cb2a4e85f (patch)
tree3abd1f1beccde1759f06bb01da1ef1326dad34d7
parent1e7a880cecfb4df0bb560f8d071cafda4889b6df (diff)
features/locks: Fix reverse logic in posix_lock_to_flock
if the lock's end point is LLONG_MAX, the corresponding struct flock's len must be 0. Previous code had LLONG_MAX and 0 reversed. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
-rw-r--r--xlators/features/locks/src/common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/features/locks/src/common.c b/xlators/features/locks/src/common.c
index 92441bde0fe..1f10aa20cf1 100644
--- a/xlators/features/locks/src/common.c
+++ b/xlators/features/locks/src/common.c
@@ -139,8 +139,8 @@ posix_lock_to_flock (posix_lock_t *lock, struct flock *flock)
flock->l_type = lock->fl_type;
flock->l_start = lock->fl_start;
- if (lock->fl_end == 0)
- flock->l_len = LLONG_MAX;
+ if (lock->fl_end == LLONG_MAX)
+ flock->l_len = 0;
else
flock->l_len = lock->fl_end - lock->fl_start + 1;
}