Skip to content

Commit

Permalink
Merge pull request #65 from jbonofre/NATIVE_FIX
Browse files Browse the repository at this point in the history
Deal with UnsatisfiedLinkError
  • Loading branch information
gnodet committed Sep 28, 2016
2 parents fad337e + 074c23b commit b84df55
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions jansi/src/main/java/org/fusesource/jansi/AnsiConsole.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,27 @@ public class AnsiConsole {
public static final PrintStream out = new PrintStream( wrapOutputStream( system_out ) );

public static final PrintStream system_err = System.err;
public static final PrintStream err = new PrintStream( wrapOutputStream( system_err, STDERR_FILENO ) );
public static final PrintStream err = new PrintStream( wrapErrorOutputStream( system_err ) );

private static int installed;

private AnsiConsole() {
}

public static OutputStream wrapOutputStream(final OutputStream stream) {
return wrapOutputStream(stream, STDOUT_FILENO);
try {
return wrapOutputStream(stream, STDOUT_FILENO);
} catch (Throwable ignore) {
return wrapOutputStream(stream, 0);
}
}

public static OutputStream wrapErrorOutputStream(final OutputStream stream) {
try {
return wrapOutputStream(stream, STDERR_FILENO);
} catch (Throwable ignore) {
return wrapOutputStream(stream, 0);
}
}

public static OutputStream wrapOutputStream(final OutputStream stream, int fileno) {
Expand Down

0 comments on commit b84df55

Please sign in to comment.