diff --git a/pom.xml b/pom.xml
index 48a6acc8a..75cf15942 100755
--- a/pom.xml
+++ b/pom.xml
@@ -26,7 +26,7 @@
4.0.0
chronicle-map
- 3.14.4-SNAPSHOT
+ 3.14.5-SNAPSHOT
OpenHFT/Chronicle-Map
Chronicle-Map
bundle
diff --git a/src/main/java/net/openhft/chronicle/hash/impl/util/jna/PosixMsync.java b/src/main/java/net/openhft/chronicle/hash/impl/util/jna/PosixMsync.java
index ecb7b0d13..45a79c476 100644
--- a/src/main/java/net/openhft/chronicle/hash/impl/util/jna/PosixMsync.java
+++ b/src/main/java/net/openhft/chronicle/hash/impl/util/jna/PosixMsync.java
@@ -17,10 +17,8 @@
package net.openhft.chronicle.hash.impl.util.jna;
-import com.sun.jna.IntegerType;
-import com.sun.jna.Native;
-import com.sun.jna.Platform;
-import com.sun.jna.Pointer;
+import com.sun.jna.*;
+import net.openhft.chronicle.core.OS;
import java.io.IOException;
@@ -36,7 +34,8 @@ public final class PosixMsync {
private static native int msync(Pointer addr, size_t length, int flags);
static {
- Native.register(PosixMsync.class, Platform.C_LIBRARY_NAME);
+ NativeLibrary clib = NativeLibrary.getInstance(Platform.C_LIBRARY_NAME);
+ Native.register(PosixMsync.class, clib);
}
private PosixMsync() {}
diff --git a/src/main/java/net/openhft/chronicle/hash/impl/util/jna/WindowsMsync.java b/src/main/java/net/openhft/chronicle/hash/impl/util/jna/WindowsMsync.java
index 846a9dbbb..f771268dc 100644
--- a/src/main/java/net/openhft/chronicle/hash/impl/util/jna/WindowsMsync.java
+++ b/src/main/java/net/openhft/chronicle/hash/impl/util/jna/WindowsMsync.java
@@ -50,7 +50,7 @@ public final class WindowsMsync {
// Finally calls FlushFileBuffers
raf.getChannel().force(false);
} else {
- throw new IOException(Kernel32Util.formatMessage(lastError));
+ throw new IOException(Kernel32Util.formatMessageFromLastErrorCode(lastError));
}
}