Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-4654

Fix C client test compilation error in Util.cc.

    XMLWordPrintableJSON

Details

    Description

      Util.cc has started to fail in compilation due to undeclared symbol nanosleep:

           [exec] /usr/local/google/home/cnauroth/zookeeper/apache-zookeeper-3.6.4/zookeeper-client/zookeeper-client-c/tests/Util.cc: In function ‘void millisleep(int)’:
           [exec] /usr/local/google/home/cnauroth/zookeeper/apache-zookeeper-3.6.4/zookeeper-client/zookeeper-client-c/tests/Util.cc:32:5: error: ‘nanosleep’ was not declared in this scope
           [exec]    32 |     nanosleep(&ts,0);
           [exec]       |     ^~~~~~~~~
           [exec] make[1]: *** [Makefile:1580: zktest_st-Util.o] Error 1
           [exec] make: *** [Makefile:2143: check-am] Error 2
      

      As per the nanosleep(2) man page, this is declared in time.h. We can fix this by including the header.

      Attachments

        Issue Links

          Activity

            People

              cnauroth Chris Nauroth
              cnauroth Chris Nauroth
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h