You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zookeeper.apache.org by mi...@apache.org on 2015/02/09 06:38:21 UTC

svn commit: r1658308 - in /zookeeper/branches/branch-3.5: CHANGES.txt src/java/main/org/apache/zookeeper/ZooKeeperMain.java

Author: michim
Date: Mon Feb  9 05:38:21 2015
New Revision: 1658308

URL: http://svn.apache.org/r1658308
Log:
ZOOKEEPER-2074 Incorrect exit codes for "./zkCli.sh cmd arg" (surendra singh lilhore via michim)

Modified:
    zookeeper/branches/branch-3.5/CHANGES.txt
    zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/ZooKeeperMain.java

Modified: zookeeper/branches/branch-3.5/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.5/CHANGES.txt?rev=1658308&r1=1658307&r2=1658308&view=diff
==============================================================================
--- zookeeper/branches/branch-3.5/CHANGES.txt (original)
+++ zookeeper/branches/branch-3.5/CHANGES.txt Mon Feb  9 05:38:21 2015
@@ -27,6 +27,9 @@ BUGFIXES:
   ZOOKEEPER-1366 Zookeeper should be tolerant of clock adjustments (Hongchao
   Deng via michim)
 
+  ZOOKEEPER-2074 Incorrect exit codes for "./zkCli.sh cmd arg" (surendra singh
+  lilhore via michim)
+
 IMPROVEMENTS:
   ZOOKEEPER-1660 Documentation for Dynamic Reconfiguration (Reed Wanderman-Milne via shralex)
 

Modified: zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/ZooKeeperMain.java
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/ZooKeeperMain.java?rev=1658308&r1=1658307&r2=1658308&view=diff
==============================================================================
--- zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/ZooKeeperMain.java (original)
+++ zookeeper/branches/branch-3.5/src/java/main/org/apache/zookeeper/ZooKeeperMain.java Mon Feb  9 05:38:21 2015
@@ -273,7 +273,10 @@ public class ZooKeeperMain {
         throws KeeperException, IOException, InterruptedException
     {
         ZooKeeperMain main = new ZooKeeperMain(args);
-        main.run();
+        boolean result = main.run();
+        if (!result) {
+            System.exit(1);
+        }
     }
 
     public ZooKeeperMain(String args[]) throws IOException, InterruptedException {
@@ -288,7 +291,7 @@ public class ZooKeeperMain {
       this.zk = zk;
     }
 
-    void run() throws KeeperException, IOException, InterruptedException {
+    boolean run() throws KeeperException, IOException, InterruptedException {
         if (cl.getCommand() == null) {
             System.out.println("Welcome to ZooKeeper!");
 
@@ -342,9 +345,10 @@ public class ZooKeeperMain {
                     executeLine(line);
                 }
             }
+            return true;
         } else {
             // Command line args non-null.  Run what was passed.
-            processCmd(cl);
+            return processCmd(cl);
         }
     }