jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1544898 - /jmeter/trunk/src/jorphan/org/apache/jorphan/exec/KeyToolUtils.java
Date Sun, 24 Nov 2013 01:32:46 GMT
Author: sebb
Date: Sun Nov 24 01:32:45 2013
New Revision: 1544898

URL: http://svn.apache.org/r1544898
Log:
Allow for MacOS's odd behaviour when it cannot find an executable

Modified:
    jmeter/trunk/src/jorphan/org/apache/jorphan/exec/KeyToolUtils.java

Modified: jmeter/trunk/src/jorphan/org/apache/jorphan/exec/KeyToolUtils.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/jorphan/org/apache/jorphan/exec/KeyToolUtils.java?rev=1544898&r1=1544897&r2=1544898&view=diff
==============================================================================
--- jmeter/trunk/src/jorphan/org/apache/jorphan/exec/KeyToolUtils.java (original)
+++ jmeter/trunk/src/jorphan/org/apache/jorphan/exec/KeyToolUtils.java Sun Nov 24 01:32:45
2013
@@ -395,12 +395,16 @@ public class KeyToolUtils {
         arguments.add(keytoolPath);
         arguments.add("-help"); // $NON-NLS-1$
         try {
+            int status = nativeCommand.run(arguments);
+            if (log.isDebugEnabled()) {
+                log.debug("checkKeyTool:status=" + status);
+                log.debug(nativeCommand.getOutResult());
+            }
             /*
-             * Don't check status return.
-             * Some implementations of keytool return non-zero status for -help
+             * Some implementations of keytool return status 1 for -help
+             * MacOS/Java 7 returns 2 if it cannot find keytool
              */
-            nativeCommand.run(arguments);
-            return true;
+            return status == 0 || status == 1; // TODO this is rather fragile
         } catch (IOException ioe) {
             return false;
         } catch (InterruptedException e) {



Mime
View raw message