1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

check for the existence of the library.

This commit is contained in:
Alain Magloire 2002-09-06 15:36:15 +00:00
parent 5a8ae1ba8f
commit 594be25e51

View file

@ -19,8 +19,12 @@ public class PTY {
InputStream in; InputStream in;
OutputStream out; OutputStream out;
private static boolean hasPTY;
public PTY() throws IOException { public PTY() throws IOException {
slave= forkpty(); if (hasPTY) {
slave= forkpty();
}
if (slave == null) { if (slave == null) {
throw new IOException("Can not create pty"); throw new IOException("Can not create pty");
} }
@ -43,7 +47,12 @@ public class PTY {
native String forkpty(); native String forkpty();
static { static {
System.loadLibrary("pty"); try {
System.loadLibrary("pty");
hasPTY = true;
} catch (SecurityException e) {
} catch (UnsatisfiedLinkError e) {
}
} }
} }