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:
parent
5a8ae1ba8f
commit
594be25e51
1 changed files with 11 additions and 2 deletions
|
@ -18,9 +18,13 @@ public class PTY {
|
||||||
public int master;
|
public int master;
|
||||||
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) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue