You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "YuQing (JIRA)" <ji...@apache.org> on 2014/09/16 04:23:33 UTC

[jira] [Created] (ZOOKEEPER-2038) Coding error in recipes/lock/src/c/src/zoo_lock.c

YuQing created ZOOKEEPER-2038:
---------------------------------

             Summary: Coding error in recipes/lock/src/c/src/zoo_lock.c
                 Key: ZOOKEEPER-2038
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2038
             Project: ZooKeeper
          Issue Type: Bug
          Components: recipes
    Affects Versions: 3.4.6
         Environment: arch linux 64bit
            Reporter: YuQing
            Priority: Minor


In fuction child_floor(), strcmp() is used to compare the whole string.
But there exists conditions a sorted_data looks like ("x-000-00", "x-222-01", "x-111-02"), and now "x-222-01" is calling child_floor() to get a predecessor for watching, so the current logic will return "x-111-02" instead of the correct "x-000-00".
Use a strcmp() == 0 and a break statement should solve this problem.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)