summaryrefslogtreecommitdiffstats
path: root/xlators/features/locks/src
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:47 -0700
commitc09dfc5f604271ecda9acf596b011dc639db2ddf (patch)
tree275da7068671f3c5ddb9c4414976c8825002c246 /xlators/features/locks/src
parenteed9ed130dd0168a669bd3df03fc0b68a989165d (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>
Diffstat (limited to 'xlators/features/locks/src')
-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 92441bde0..1f10aa20c 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;
}