Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Zarna2009-01-07 12:22:15 +0000
committerTomasz Zarna2009-01-07 12:22:15 +0000
commita4511e47556b294ef6cbc192cbdc47b082f8a717 (patch)
treea1a624dfecbadd70ff55ac338ee8f4e5197deb6a /bundles/org.eclipse.core.net/src
parentea24196c67394a6b17d3e8b2b85cace7dac73b3d (diff)
downloadeclipse.platform.team-a4511e47556b294ef6cbc192cbdc47b082f8a717.tar.gz
eclipse.platform.team-a4511e47556b294ef6cbc192cbdc47b082f8a717.tar.xz
eclipse.platform.team-a4511e47556b294ef6cbc192cbdc47b082f8a717.zip
bug 258941: [Net] Unknown process error
Diffstat (limited to 'bundles/org.eclipse.core.net/src')
-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