1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

Only spawn WSL detct job on Windows

There is no need to spawn the WSL detect job for other platforms than
Windows.

Contributed by STMicroelectronics

Change-Id: I85256a9f6a4f5e9e9276458ba67e2f6adf02afa7
Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
This commit is contained in:
Torbjörn Svensson 2021-08-15 14:52:10 +02:00
parent 432ca56fd3
commit eb7aa70a9f

View file

@ -38,6 +38,12 @@ public class DetectWSL implements IDetectExternalExecutable {
private List<Map<String, String>> result = null;
private WslDetectJob detectJob = null;
public DetectWSL() {
if (!Platform.OS_WIN32.equals(Platform.getOS())) {
result = Collections.emptyList();
}
}
@Override
public boolean hasEntries() {
return !getEntries().isEmpty();
@ -95,7 +101,6 @@ public class DetectWSL implements IDetectExternalExecutable {
protected IStatus run(IProgressMonitor monitor) {
if (result == null) {
result = Collections.emptyList();
if (Platform.OS_WIN32.equals(Platform.getOS())) {
String windir = System.getenv("windir"); //$NON-NLS-1$
if (windir == null) {
return Status.OK_STATUS;
@ -142,7 +147,6 @@ public class DetectWSL implements IDetectExternalExecutable {
} catch (IOException e) {
}
}
}
return Status.OK_STATUS;
}