JDK-8080990: libdt_socket/socket_md.c(202) : warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW()

Langer, Christoph christoph.langer at sap.com
Thu Feb 1 08:11:15 UTC 2018


Hi Gary,

I was having a look at your changes.

I'm wondering what the reason is behind uncommenting WSASendDisconnect in Java_sun_nio_ch_SocketDispatcher_preClose0 of file SocketDispatcher.c? And in dbgsysSocketClose?

In socketTransport.c, line:
    331                 setLastError(0, "gethostbyname: unknown host");
you should change the description text of the error to getaddrinfo instead of gethostbyname.

Best regards
Christoph



-----Original Message-----
From: build-dev [mailto:build-dev-bounces at openjdk.java.net] On Behalf Of Gary Adams
Sent: Donnerstag, 25. Januar 2018 19:47
To: OpenJDK Serviceability <serviceability-dev at openjdk.java.net>; OpenJDK Build <build-dev at openjdk.java.net>; OpenJDK Networking <net-dev at openjdk.java.net>
Subject: RFR: JDK-8080990: libdt_socket/socket_md.c(202) : warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW()

Here's a first pass attempt to remove the -D_WINSOCK_DEPRECATED_NO_WARNINGS
build flag and update the winsock deprecated functions.

   Issue: https://bugs.openjdk.java.net/browse/JDK-8080990
   Webrev: http://cr.openjdk.java.net/~gadams/8080990/

These are the initial deprecated functions updated:
    gethostbyname -> getaddrinfo
    inet_addr -> inet_pton
    inet_ntoa -> inet_ntop

I'm not sure how to replace the existing WSASendDisconnect calls.
It's not clear that it actually provides a graceful disconnect.




More information about the build-dev mailing list