Skip to content

Commit 831e875

Browse files
authored
Merge pull request jruby#9347 from headius/jdk_flock_windows
Use JDK for File#flock on Windows
2 parents e50e94a + 881a0d9 commit 831e875

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

core/src/main/java/org/jruby/util/io/PosixShim.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ public int flock(ChannelFD fd, int lockMode) {
216216

217217
int real_fd = fd.realFileno;
218218

219-
if (posix.isNative() && real_fd != -1 && real_fd < FilenoUtil.FIRST_FAKE_FD && !Platform.IS_SOLARIS) {
219+
if (!Platform.IS_SOLARIS && !Platform.IS_WINDOWS &&
220+
posix.isNative() && real_fd != -1 && real_fd < FilenoUtil.FIRST_FAKE_FD) {
220221
// we have a real fd and not on Solaris...try native flocking
221222
// see jruby/jruby#3254 and jnr/jnr-posix#60
222223
int result = posix.flock(real_fd, lockMode);

0 commit comments

Comments
 (0)