From 594be25e51ba77d19ac30a8b4f833f214bdd3c31 Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Fri, 6 Sep 2002 15:36:15 +0000 Subject: [PATCH] check for the existence of the library. --- .../utils/org/eclipse/cdt/utils/pty/PTY.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/pty/PTY.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/pty/PTY.java index 84c3f08a441..bc1354c32ce 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/pty/PTY.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/pty/PTY.java @@ -18,9 +18,13 @@ public class PTY { public int master; InputStream in; OutputStream out; + + private static boolean hasPTY; public PTY() throws IOException { - slave= forkpty(); + if (hasPTY) { + slave= forkpty(); + } if (slave == null) { throw new IOException("Can not create pty"); } @@ -43,7 +47,12 @@ public class PTY { native String forkpty(); static { - System.loadLibrary("pty"); + try { + System.loadLibrary("pty"); + hasPTY = true; + } catch (SecurityException e) { + } catch (UnsatisfiedLinkError e) { + } } }