zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maha...@apache.org
Subject svn commit: r1162013 - in /zookeeper/trunk: CHANGES.txt src/c/src/cli.c src/c/src/zookeeper.c
Date Fri, 26 Aug 2011 07:42:35 GMT
Author: mahadev
Date: Fri Aug 26 07:42:35 2011
New Revision: 1162013

URL: http://svn.apache.org/viewvc?rev=1162013&view=rev
Log:
ZOOKEEPER-1117. zookeeper 3.3.3 fails to build with gcc >= 4.6.1 on Debian/Ubuntu (James
Page via mahadev)

Modified:
    zookeeper/trunk/CHANGES.txt
    zookeeper/trunk/src/c/src/cli.c
    zookeeper/trunk/src/c/src/zookeeper.c

Modified: zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/trunk/CHANGES.txt?rev=1162013&r1=1162012&r2=1162013&view=diff
==============================================================================
--- zookeeper/trunk/CHANGES.txt (original)
+++ zookeeper/trunk/CHANGES.txt Fri Aug 26 07:42:35 2011
@@ -292,6 +292,9 @@ BUGFIXES: 
   
   ZOOKEEPER-1025. zkCli is overly sensitive to to spaces. (Laxman via camille)
 
+  ZOOKEEPER-1117. zookeeper 3.3.3 fails to build with gcc >= 4.6.1 on
+  Debian/Ubuntu (James Page via mahadev)
+
 IMPROVEMENTS:
   ZOOKEEPER-724. Improve junit test integration - log harness information 
   (phunt via mahadev)

Modified: zookeeper/trunk/src/c/src/cli.c
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/c/src/cli.c?rev=1162013&r1=1162012&r2=1162013&view=diff
==============================================================================
--- zookeeper/trunk/src/c/src/cli.c (original)
+++ zookeeper/trunk/src/c/src/cli.c Fri Aug 26 07:42:35 2011
@@ -595,11 +595,13 @@ int main(int argc, char **argv) {
         FD_SET(0, &rfds);
         rc = select(fd+1, &rfds, &wfds, &efds, &tv);
         events = 0;
-        if (FD_ISSET(fd, &rfds)) {
-            events |= ZOOKEEPER_READ;
-        }
-        if (FD_ISSET(fd, &wfds)) {
-            events |= ZOOKEEPER_WRITE;
+        if (rc > 0) {
+            if (FD_ISSET(fd, &rfds)) {
+                events |= ZOOKEEPER_READ;
+            }
+            if (FD_ISSET(fd, &wfds)) {
+                events |= ZOOKEEPER_WRITE;
+            }
         }
         if(batchMode && processed==0){
           //batch mode

Modified: zookeeper/trunk/src/c/src/zookeeper.c
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/c/src/zookeeper.c?rev=1162013&r1=1162012&r2=1162013&view=diff
==============================================================================
--- zookeeper/trunk/src/c/src/zookeeper.c (original)
+++ zookeeper/trunk/src/c/src/zookeeper.c Fri Aug 26 07:42:35 2011
@@ -480,7 +480,7 @@ int getaddrs(zhandle_t *zh)
         *port_spec = '\0';
         port_spec++;
         port = strtol(port_spec, &end_port_spec, 0);
-        if (!*port_spec || *end_port_spec) {
+        if (!*port_spec || *end_port_spec || port == 0) {
             LOG_ERROR(("invalid port in %s", host));
             errno=EINVAL;
             rc=ZBADARGUMENTS;



Mime
View raw message