Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.
/ jdk16 Public archive

Commit

Permalink
8259014: (so) ServerSocketChannel.bind(UnixDomainSocketAddress)/Socke…
Browse files Browse the repository at this point in the history
…tChannel.bind(UnixDomainSocketAddress) will have unknown user and group owner (win)

Reviewed-by: alanb
  • Loading branch information
Michael-Mc-Mahon committed Jan 8, 2021
1 parent 677802d commit fb68395
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/java.base/windows/native/libnio/ch/UnixDomainSockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,16 @@ Java_sun_nio_ch_UnixDomainSockets_socketSupported(JNIEnv *env, jclass cl)
return JNI_FALSE;
}
closesocket(s);
return JNI_TRUE;

/* Check for build 18362 or newer, due to Windows bug described in 8259014 */

OSVERSIONINFOEXW osvi = { sizeof(osvi), 0, 0, 0, 0, {0}, 0, 0 };
DWORDLONG cond_mask = 0;

VER_SET_CONDITION(cond_mask, VER_BUILDNUMBER, VER_GREATER_EQUAL);
osvi.dwBuildNumber = 18362; // Windows 10 (1903) or newer

return VerifyVersionInfoW(&osvi, VER_BUILDNUMBER, cond_mask) != 0;
}

JNIEXPORT jint JNICALL
Expand Down

1 comment on commit fb68395

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.