Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/unix/UnixProxyProvider.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/unix/UnixProxyProvider.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/unix/UnixProxyProvider.java
index 77642c15f..1bbb31c7f 100644
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/unix/UnixProxyProvider.java
+++ b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/unix/UnixProxyProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Oakland Software Incorporated and others
+ * Copyright (c) 2008, 2009 Oakland Software Incorporated and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -180,19 +180,24 @@ public class UnixProxyProvider extends AbstractProxyProvider {
return null;
}
- private String getEnv(String env) {
+ private synchronized String getEnv(String env) {
String cmd[] = { "/bin/sh", //$NON-NLS-1$
"-c", //$NON-NLS-1$
"env | grep -i proxy" }; //$NON-NLS-1$
Properties props = new Properties();
try {
- props.load(Runtime.getRuntime().exec(cmd).getInputStream());
+ Process proc = Runtime.getRuntime().exec(cmd);
+ props.load(proc.getInputStream());
+ proc.waitFor();
} catch (IOException e) {
Activator.logError(
"Problem during accessing system variable: " + env, e); //$NON-NLS-1$
} catch (IllegalArgumentException e) {
Activator.logError(
"Problem during accessing system variable: " + env, e); //$NON-NLS-1$
+ } catch (InterruptedException e) {
+ Activator.logError(
+ "Problem during accessing system variable: " + env, e); //$NON-NLS-1$
}
return props.getProperty(env);
}

Back to the top