提交 91000fa5 编写于 作者: J Jesse Glick

Merge pull request #752 from lmwang/master

[FIXED JENKINS-8614] ProcessTreeTest fails on Windows 
......@@ -67,6 +67,7 @@ import java.util.logging.Logger;
import static com.sun.jna.Pointer.NULL;
import static hudson.util.jna.GNUCLibrary.LIBC;
import static java.util.logging.Level.FINE;
import static java.util.logging.Level.FINER;
import static java.util.logging.Level.FINEST;
......@@ -424,7 +425,17 @@ public abstract class ProcessTree implements Iterable<OSProcess>, IProcessTree,
@Override
public synchronized EnvVars getEnvironmentVariables() {
if(env==null) env = new EnvVars(p.getEnvironmentVariables());
if(env !=null)
return env;
env = new EnvVars();
try
{
env.putAll(p.getEnvironmentVariables());
} catch (WinpException e)
{
LOGGER.log(FINE, "Failed to get environment variable ", e);
}
return env;
}
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册