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
|
@ -19,8 +19,12 @@ public class PTY {
|
|||
InputStream in;
|
||||
OutputStream out;
|
||||
|
||||
private static boolean hasPTY;
|
||||
|
||||
public PTY() throws IOException {
|
||||
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 {
|
||||
try {
|
||||
System.loadLibrary("pty");
|
||||
hasPTY = true;
|
||||
} catch (SecurityException e) {
|
||||
} catch (UnsatisfiedLinkError e) {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue