From 1a12559821bacb65cfa341c55cb4893e76f1ee17 Mon Sep 17 00:00:00 2001 From: Alex Dupre Date: Mon, 2 Feb 2015 09:52:13 +0100 Subject: [PATCH] Fix loading of C native library on FreeBSD with JNA < 4.1.0. --- .../intellij/execution/process/UnixProcessManager.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/platform/util/src/com/intellij/execution/process/UnixProcessManager.java b/platform/util/src/com/intellij/execution/process/UnixProcessManager.java index 69c8ce5425f18..6356157c85673 100644 --- a/platform/util/src/com/intellij/execution/process/UnixProcessManager.java +++ b/platform/util/src/com/intellij/execution/process/UnixProcessManager.java @@ -46,7 +46,13 @@ public class UnixProcessManager { static { try { if (!Platform.isWindows()) { - C_LIB = ((CLib)Native.loadLibrary("c", CLib.class)); + if (Platform.isFreeBSD()) { + // workaround needed on FreeBSD >= 10 and JNA < 4.1.0, + // harmless in other cases. + C_LIB = ((CLib)Native.loadLibrary("/lib/libc.so.7", CLib.class)); + } else { + C_LIB = ((CLib)Native.loadLibrary("c", CLib.class)); + } } } catch (Throwable e) {