Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import scala.collection.mutable.ArrayBuffer
import scala.util.Try
import scala.sys.process._

val jnaVersion = "5.12.0"
val jnaVersion = "5.19.0"
val jna = "net.java.dev.jna" % "jna" % jnaVersion

val jnaPlatform = "net.java.dev.jna" % "jna-platform" % jnaVersion
Expand Down Expand Up @@ -105,13 +105,18 @@ buildWin32X86_64 / skip := {
}, _.isEmpty)
}
Test / fork := true
Test / javaOptions ++= {
import scala.util.Properties
if (Properties.isJavaAtLeast("11")) Seq("--enable-native-access=ALL-UNNAMED")
else Nil
}
Test / testGrouping := {
val tests = (Test / definedTests).value
tests
.groupBy(_.name)
.map {
case (name, tests) =>
val options = ForkOptions()
val options = (Test / forkOptions).value
new Tests.Group(name, tests, Tests.SubProcess(options))
}
.toSeq
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,14 @@ public int available(int fd) throws NativeErrorException {
} else {
op = UnixDomainSocketLibrary.FIONREAD;
}
UnixDomainSocketLibrary.ioctl(fd, op, len);
final int r = UnixDomainSocketLibrary.ioctl(fd, op, len);
if (r != 0) {
if (pollRead(fd, 0)) {
return 1;
} else {
return 0;
}
}
return len.getValue();
} catch (final LastErrorException e) {
if (pollRead(fd, 0)) {
Expand Down