Ver código fonte

ZOOKEEPER-1646. mt c client tests fail on Ubuntu Raring (phunt)

git-svn-id: https://svn.apache.org/repos/asf/zookeeper/trunk@1533161 13f79535-47bb-0310-9956-ffa450edef68
Patrick D. Hunt 11 anos atrás
pai
commit
80c6bd4a6d
2 arquivos alterados com 13 adições e 0 exclusões
  1. 2 0
      CHANGES.txt
  2. 11 0
      src/c/tests/LibCMocks.cc

+ 2 - 0
CHANGES.txt

@@ -448,6 +448,8 @@ BUGFIXES:
   ZOOKEEPER-1795. unable to build c client on ubuntu
   (Raul Gutierrez Segales via phunt)
 
+  ZOOKEEPER-1646. mt c client tests fail on Ubuntu Raring (phunt)
+
 IMPROVEMENTS:
 
   ZOOKEEPER-1170. Fix compiler (eclipse) warnings: unused imports,

+ 11 - 0
src/c/tests/LibCMocks.cc

@@ -310,6 +310,17 @@ int poll(struct pollfd *fds, POLL_NFDS_TYPE nfds, int timeout){
     
 }
 
+/*
+ * Recent gcc with -O2 and glibc FORTIFY feature may cause our poll
+ * mock to be ignored.
+ */
+#if __USE_FORTIFY_LEVEL > 0
+int __poll_chk (struct pollfd *__fds, nfds_t __nfds, int __timeout,
+                __SIZE_TYPE__ __fdslen) {
+    return poll(__fds, __nfds, __timeout);
+}
+#endif
+
 // *****************************************************************************
 // gettimeofday
 int gettimeofday(struct timeval *tp, GETTIMEOFDAY_ARG2_TYPE tzp){