8130317: "ant test" fails to complete on Windows when run under cygwin shell
authorsundar
Thu, 02 Jul 2015 19:02:28 +0530
changeset 31493 369a368c56b2
parent 31492 f8c2cc6528ad
child 31494 93250cfbfa54
8130317: "ant test" fails to complete on Windows when run under cygwin shell Reviewed-by: lagergren, attila
nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptingFunctions.java
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptingFunctions.java	Thu Jul 02 11:20:47 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptingFunctions.java	Thu Jul 02 19:02:28 2015 +0530
@@ -163,7 +163,10 @@
             // If a working directory is present, use it.
             final Object pwd = envProperties.get(PWD_NAME);
             if (pwd != UNDEFINED) {
-                processBuilder.directory(new File(JSType.toString(pwd)));
+                final File pwdFile = new File(JSType.toString(pwd));
+                if (pwdFile.exists()) {
+                    processBuilder.directory(pwdFile);
+                }
             }
 
             // Set up ENV variables.