diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/Spawner.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/Spawner.java index c8f66f41118..c003698ebf9 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/Spawner.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/Spawner.java @@ -483,19 +483,21 @@ public class Spawner extends Process { @Override public void run() { + int _pid; try { - pid = execute(fCmdarray, fEnvp, fDirpath, fChannels); + _pid = execute(fCmdarray, fEnvp, fDirpath, fChannels); } catch (Exception e) { - pid = -1; + _pid = -1; fException= e; } // Tell spawner that the process started. synchronized (Spawner.this) { + pid = _pid; Spawner.this.notifyAll(); } - if (pid != -1) { + if (_pid != -1) { // Sync with spawner and notify when done. status = waitFor(pid); synchronized (Spawner.this) {