activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject activemq git commit: https://issues.apache.org/jira/browse/AMQ-5841 - activemq script returns a non zero exit code for successful operations
Date Mon, 15 Jun 2015 10:30:23 GMT
Repository: activemq
Updated Branches:
  refs/heads/master 732fd5684 -> e2221e31f


https://issues.apache.org/jira/browse/AMQ-5841 - activemq script returns a non zero exit code
for successful operations


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/e2221e31
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/e2221e31
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/e2221e31

Branch: refs/heads/master
Commit: e2221e31fa4ffef524d0026fa1d26728152be56b
Parents: 732fd56
Author: Dejan Bosanac <dejan@nighttale.net>
Authored: Mon Jun 15 12:30:13 2015 +0200
Committer: Dejan Bosanac <dejan@nighttale.net>
Committed: Mon Jun 15 12:30:13 2015 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/activemq/console/Main.java      | 8 ++++----
 .../org/apache/activemq/console/command/ShellCommand.java    | 2 +-
 assembly/src/release/bin/activemq                            | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/e2221e31/activemq-console/src/main/java/org/apache/activemq/console/Main.java
----------------------------------------------------------------------
diff --git a/activemq-console/src/main/java/org/apache/activemq/console/Main.java b/activemq-console/src/main/java/org/apache/activemq/console/Main.java
index a4dfe0b..67c2562 100644
--- a/activemq-console/src/main/java/org/apache/activemq/console/Main.java
+++ b/activemq-console/src/main/java/org/apache/activemq/console/Main.java
@@ -112,8 +112,8 @@ public class Main {
         app.addClassPathList(System.getProperty("activemq.classpath"));
 
         try {
-            app.runTaskClass(tokens);
-            System.exit(0);
+            int ret = app.runTaskClass(tokens);
+            System.exit(ret);
         } catch (ClassNotFoundException e) {
             System.out.println("Could not load class: " + e.getMessage());
             try {
@@ -216,7 +216,7 @@ public class Main {
 
     }
 
-    public void runTaskClass(List<String> tokens) throws Throwable {
+    public int runTaskClass(List<String> tokens) throws Throwable {
 
         StringBuilder buffer = new StringBuilder();
         buffer.append(System.getProperty("java.vendor"));
@@ -259,7 +259,7 @@ public class Main {
             Method runTask = task.getMethod("main", new Class[] {
                 String[].class, InputStream.class, PrintStream.class
             });
-            runTask.invoke(task.newInstance(), args, System.in, System.out);
+            return (int)runTask.invoke(task.newInstance(), args, System.in, System.out);
         } catch (InvocationTargetException e) {
             throw e.getCause();
         }

http://git-wip-us.apache.org/repos/asf/activemq/blob/e2221e31/activemq-console/src/main/java/org/apache/activemq/console/command/ShellCommand.java
----------------------------------------------------------------------
diff --git a/activemq-console/src/main/java/org/apache/activemq/console/command/ShellCommand.java
b/activemq-console/src/main/java/org/apache/activemq/console/command/ShellCommand.java
index ad6bfc5..61ee207 100644
--- a/activemq-console/src/main/java/org/apache/activemq/console/command/ShellCommand.java
+++ b/activemq-console/src/main/java/org/apache/activemq/console/command/ShellCommand.java
@@ -105,7 +105,7 @@ public class ShellCommand extends AbstractCommand {
             return 0;
         } catch (Exception e) {
             context.printException(e);
-            return -1;
+            return 1;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/activemq/blob/e2221e31/assembly/src/release/bin/activemq
----------------------------------------------------------------------
diff --git a/assembly/src/release/bin/activemq b/assembly/src/release/bin/activemq
index 100e0cd..de448da 100755
--- a/assembly/src/release/bin/activemq
+++ b/assembly/src/release/bin/activemq
@@ -538,7 +538,7 @@ invoke_task(){
       exit $?
     else
       invokeJar
-      exit 1
+      exit $?
     fi
 }
 


Mime
View raw message