8130317: "ant test" fails to complete on Windows when run under cygwin shell
Reviewed-by: lagergren, attila
--- 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.