--- a/make/autoconf/configure Thu Feb 08 06:16:49 2018 -0800
+++ b/make/autoconf/configure Thu Feb 08 06:19:24 2018 -0800
@@ -129,25 +129,18 @@
}
test_generated_up_to_date() {
- if test "x`which hg 2> /dev/null | grep -v '^no hg in'`" != x; then
- conf_updated_autoconf_files=`cd $conf_script_dir && hg status -mard . 2> /dev/null`
- conf_source_files="$conf_script_dir/configure.ac $conf_script_dir/*.m4"
- if test "x$CUSTOM_CONFIG_DIR" != x; then
- conf_custom_updated_autoconf_files=`cd $CUSTOM_CONFIG_DIR && hg status -mard . 2> /dev/null`
- conf_custom_source_files="$CUSTOM_CONFIG_DIR/*.m4"
- else
- conf_custom_updated_autoconf_files=""
- conf_custom_source_files=""
+ conf_source_files="$conf_script_dir/configure.ac $conf_script_dir/*.m4"
+ if test "x$CUSTOM_CONFIG_DIR" != x; then
+ conf_custom_source_files="$CUSTOM_CONFIG_DIR/*.m4"
+ else
+ conf_custom_source_files=""
+ fi
+
+ for file in $conf_source_files $conf_custom_source_files ; do
+ if test $file -nt $generated_script; then
+ return 0
fi
-
- if test "x${conf_updated_autoconf_files}${conf_custom_updated_autoconf_files}" != x; then
- for file in $conf_source_files $conf_custom_source_files ; do
- if test $file -nt $generated_script; then
- return 0
- fi
- done
- fi
- fi
+ done
return 1
}
--- a/make/autoconf/flags.m4 Thu Feb 08 06:16:49 2018 -0800
+++ b/make/autoconf/flags.m4 Thu Feb 08 06:19:24 2018 -0800
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -918,7 +918,6 @@
-MD -Zc:wchar_t- -W3 -wd4800 \
-DWIN32_LEAN_AND_MEAN \
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \
- -D_WINSOCK_DEPRECATED_NO_WARNINGS \
-DWIN32 -DIAL"
if test "x$OPENJDK_$1_CPU" = xx86_64; then
$2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_AMD64_ -Damd64"
--- a/make/launcher/Launcher-jdk.pack.gmk Thu Feb 08 06:16:49 2018 -0800
+++ b/make/launcher/Launcher-jdk.pack.gmk Thu Feb 08 06:19:24 2018 -0800
@@ -82,7 +82,7 @@
CFLAGS_linux := -fPIC, \
CFLAGS_solaris := -KPIC, \
CFLAGS_macosx := -fPIC, \
- DISABLED_WARNINGS_gcc := unused-result, \
+ DISABLED_WARNINGS_gcc := unused-result implicit-fallthrough, \
MAPFILE := $(UNPACK_MAPFILE),\
LDFLAGS := $(UNPACKEXE_ZIPOBJS) \
$(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
--- a/make/lib/Awt2dLibraries.gmk Thu Feb 08 06:16:49 2018 -0800
+++ b/make/lib/Awt2dLibraries.gmk Thu Feb 08 06:19:24 2018 -0800
@@ -358,7 +358,8 @@
WARNINGS_AS_ERRORS_xlc := false, \
DISABLED_WARNINGS_gcc := type-limits pointer-to-int-cast \
unused-result maybe-uninitialized format \
- format-security int-to-pointer-cast parentheses, \
+ format-security int-to-pointer-cast parentheses \
+ implicit-fallthrough, \
DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE \
E_ASSIGNMENT_TYPE_MISMATCH E_NON_CONST_INIT, \
MAPFILE := $(TOPDIR)/make/mapfiles/libawt_xawt/mapfile-vers, \
@@ -491,7 +492,7 @@
CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBJAVAJPEG_HEADERS) \
$(LIBJAVA_HEADER_FLAGS) \
-I$(SUPPORT_OUTPUTDIR)/headers/java.desktop, \
- DISABLED_WARNINGS_gcc := clobbered, \
+ DISABLED_WARNINGS_gcc := clobbered implicit-fallthrough shift-negative-value, \
MAPFILE := $(TOPDIR)/make/mapfiles/libjpeg/mapfile-vers, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
@@ -669,7 +670,7 @@
CFLAGS_windows = -DCC_NOEX, \
WARNINGS_AS_ERRORS_xlc := false, \
DISABLED_WARNINGS_gcc := sign-compare int-to-pointer-cast \
- type-limits missing-field-initializers, \
+ type-limits missing-field-initializers implicit-fallthrough, \
DISABLED_WARNINGS_CXX_gcc := reorder delete-non-virtual-dtor strict-overflow \
maybe-uninitialized, \
DISABLED_WARNINGS_clang := unused-value incompatible-pointer-types \
@@ -943,7 +944,8 @@
OPTIMIZATION := LOW, \
CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) \
$(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS), \
- DISABLED_WARNINGS_gcc := sign-compare type-limits unused-result maybe-uninitialized shift-negative-value, \
+ DISABLED_WARNINGS_gcc := sign-compare type-limits unused-result \
+ maybe-uninitialized shift-negative-value implicit-fallthrough, \
DISABLED_WARNINGS_clang := incompatible-pointer-types, \
DISABLED_WARNINGS_solstudio := E_NEWLINE_NOT_LAST E_DECLARATION_IN_CODE \
E_STATEMENT_NOT_REACHED, \
--- a/make/lib/CoreLibraries.gmk Thu Feb 08 06:16:49 2018 -0800
+++ b/make/lib/CoreLibraries.gmk Thu Feb 08 06:19:24 2018 -0800
@@ -67,7 +67,7 @@
CFLAGS_linux_ppc64le := -ffp-contract=off, \
CFLAGS_linux_s390x := -ffp-contract=off, \
CFLAGS_linux_aarch64 := -ffp-contract=off, \
- DISABLED_WARNINGS_gcc := sign-compare, \
+ DISABLED_WARNINGS_gcc := sign-compare misleading-indentation, \
DISABLED_WARNINGS_microsoft := 4146 4244 4018, \
ARFLAGS := $(ARFLAGS), \
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \
@@ -113,6 +113,7 @@
SRC := $(TOPDIR)/src/java.base/share/native/libverify, \
OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \
CFLAGS := $(CFLAGS_JDKLIB), \
+ DISABLED_WARNINGS_gcc := implicit-fallthrough, \
DISABLED_WARNINGS_microsoft := 4244 4267, \
MAPFILE := $(TOPDIR)/make/mapfiles/libverify/mapfile-vers, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
@@ -229,6 +230,7 @@
-I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
-I$(SUPPORT_OUTPUTDIR)/headers/java.base, \
CFLAGS_unix := $(BUILD_LIBZIP_MMAP) -UDEBUG, \
+ DISABLED_WARNINGS_gcc := implicit-fallthrough, \
MAPFILE := $(TOPDIR)/make/mapfiles/libzip/mapfile-vers, \
REORDER := $(BUILD_LIBZIP_REORDER), \
LDFLAGS := $(LDFLAGS_JDKLIB) \
@@ -270,6 +272,7 @@
EXCLUDES := $(LIBJIMAGE_EXCLUDES), \
CFLAGS := $(CFLAGS_JDKLIB) $(JIMAGELIB_CPPFLAGS), \
CXXFLAGS := $(CXXFLAGS_JDKLIB) $(JIMAGELIB_CPPFLAGS), \
+ DISABLED_WARNINGS_gcc := implicit-fallthrough, \
CFLAGS_unix := -UDEBUG, \
MAPFILE := $(TOPDIR)/make/mapfiles/libjimage/mapfile-vers, \
LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
@@ -363,6 +366,7 @@
EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
OPTIMIZATION := HIGH, \
CFLAGS := $(LIBJLI_CFLAGS), \
+ DISABLED_WARNINGS_gcc := maybe-uninitialized, \
DISABLED_WARNINGS_solstudio := \
E_ASM_DISABLES_OPTIMIZATION \
E_STATEMENT_NOT_REACHED, \
--- a/make/lib/Lib-jdk.crypto.ec.gmk Thu Feb 08 06:16:49 2018 -0800
+++ b/make/lib/Lib-jdk.crypto.ec.gmk Thu Feb 08 06:19:24 2018 -0800
@@ -54,7 +54,7 @@
-DMP_API_COMPATIBLE -DNSS_ECC_MORE_THAN_SUITE_B, \
CXXFLAGS := $(filter-out $(ECC_JNI_SOLSPARC_FILTER), $(CXXFLAGS_JDKLIB)) \
$(BUILD_LIBSUNEC_FLAGS), \
- DISABLED_WARNINGS_gcc := sign-compare, \
+ DISABLED_WARNINGS_gcc := sign-compare implicit-fallthrough, \
DISABLED_WARNINGS_microsoft := 4101 4244 4146 4018, \
MAPFILE := $(TOPDIR)/make/mapfiles/libsunec/mapfile-vers, \
LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \
--- a/make/lib/Lib-jdk.jdwp.agent.gmk Thu Feb 08 06:16:49 2018 -0800
+++ b/make/lib/Lib-jdk.jdwp.agent.gmk Thu Feb 08 06:19:24 2018 -0800
@@ -43,6 +43,7 @@
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB) -DUSE_MMAP \
$(LIBDT_SOCKET_CPPFLAGS), \
+ DISABLED_WARNINGS_gcc := shift-negative-value, \
MAPFILE := $(TOPDIR)/make/mapfiles/libdt_socket/mapfile-vers, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
--- a/make/lib/Lib-jdk.pack.gmk Thu Feb 08 06:16:49 2018 -0800
+++ b/make/lib/Lib-jdk.pack.gmk Thu Feb 08 06:19:24 2018 -0800
@@ -40,6 +40,7 @@
-I$(TOPDIR)/src/jdk.pack/share/native/common-unpack \
$(LIBJAVA_HEADER_FLAGS), \
CFLAGS_release := -DPRODUCT, \
+ DISABLED_WARNINGS_gcc := implicit-fallthrough, \
MAPFILE := $(TOPDIR)/make/mapfiles/libunpack/mapfile-vers, \
LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
--- a/src/java.base/windows/native/libnet/net_util_md.c Thu Feb 08 06:16:49 2018 -0800
+++ b/src/java.base/windows/native/libnet/net_util_md.c Thu Feb 08 06:19:24 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -525,7 +525,7 @@
int len = sizeof (l);
if (getsockopt(fd, SOL_SOCKET, SO_LINGER, (char *)&l, &len) == 0) {
if (l.l_onoff == 0) {
- WSASendDisconnect(fd, NULL);
+ shutdown(fd, SD_SEND);
}
}
ret = closesocket (fd);
--- a/src/java.base/windows/native/libnio/ch/SocketDispatcher.c Thu Feb 08 06:16:49 2018 -0800
+++ b/src/java.base/windows/native/libnio/ch/SocketDispatcher.c Thu Feb 08 06:19:24 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -272,7 +272,7 @@
int len = sizeof(l);
if (getsockopt(fd, SOL_SOCKET, SO_LINGER, (char *)&l, &len) == 0) {
if (l.l_onoff == 0) {
- WSASendDisconnect(fd, NULL);
+ shutdown(fd, SD_SEND);
}
}
}
--- a/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c Thu Feb 08 06:16:49 2018 -0800
+++ b/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c Thu Feb 08 06:19:24 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -228,6 +228,7 @@
// it looks up "localhost" and returns 127.0.0.1 if lookup
// fails.
struct addrinfo hints, *res = NULL;
+ uint32_t addr;
int err;
// Use portable way to initialize the structure
@@ -241,7 +242,9 @@
// getaddrinfo might return more than one address
// but we are using first one only
- return ((struct sockaddr_in *)(res->ai_addr))->sin_addr.s_addr;
+ addr = ((struct sockaddr_in *)(res->ai_addr))->sin_addr.s_addr;
+ freeaddrinfo(res);
+ return addr;
}
static int
@@ -300,7 +303,7 @@
char *buf;
char *hostname;
uint32_t addr;
-
+ int ai;
buf = (*callback->alloc)((int)strlen(address) + 1);
if (buf == NULL) {
RETURN_ERROR(JDWPTRANSPORT_ERROR_OUT_OF_MEMORY, "out of memory");
@@ -315,16 +318,25 @@
*/
addr = dbgsysInetAddr(hostname);
if (addr == 0xffffffff) {
- struct hostent *hp = dbgsysGetHostByName(hostname);
- if (hp == NULL) {
+ struct addrinfo hints;
+ struct addrinfo *results = NULL;
+ memset (&hints, 0, sizeof(hints));
+ hints.ai_family = AF_INET;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_protocol = IPPROTO_TCP;
+
+ ai = dbgsysGetAddrInfo(hostname, NULL, &hints, &results);
+
+ if (ai != 0) {
/* don't use RETURN_IO_ERROR as unknown host is normal */
- setLastError(0, "gethostbyname: unknown host");
+ setLastError(0, "getaddrinfo: unknown host");
(*callback->free)(buf);
return JDWPTRANSPORT_ERROR_IO_ERROR;
}
/* lookup was successful */
- memcpy(&(sa->sin_addr), hp->h_addr_list[0], hp->h_length);
+ sa->sin_addr = ((struct sockaddr_in *)results->ai_addr)->sin_addr;
+ freeaddrinfo(results);
} else {
sa->sin_addr.s_addr = addr;
}
--- a/src/jdk.jdwp.agent/share/native/libdt_socket/sysSocket.h Thu Feb 08 06:16:49 2018 -0800
+++ b/src/jdk.jdwp.agent/share/native/libdt_socket/sysSocket.h Thu Feb 08 06:19:24 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,7 @@
int dbgsysListen(int fd, int backlog);
int dbgsysRecv(int fd, char *buf, size_t nBytes, int flags);
int dbgsysSend(int fd, char *buf, size_t nBytes, int flags);
-struct hostent *dbgsysGetHostByName(char *hostname);
+int dbgsysGetAddrInfo(char *hostname, char *service, struct addrinfo *hints, struct addrinfo **results);
int dbgsysSocket(int domain, int type, int protocol);
int dbgsysBind(int fd, struct sockaddr *name, socklen_t namelen);
int dbgsysSetSocketOption(int fd, jint cmd, jboolean on, jvalue value);
--- a/src/jdk.jdwp.agent/unix/native/libdt_socket/socket_md.c Thu Feb 08 06:16:49 2018 -0800
+++ b/src/jdk.jdwp.agent/unix/native/libdt_socket/socket_md.c Thu Feb 08 06:19:24 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -126,9 +126,11 @@
return rv;
}
-struct hostent *
-dbgsysGetHostByName(char *hostname) {
- return gethostbyname(hostname);
+int
+dbgsysGetAddrInfo(char *hostname, char *service,
+ struct addrinfo *hints,
+ struct addrinfo **results) {
+ return getaddrinfo(hostname, service, hints, results);
}
unsigned short
--- a/src/jdk.jdwp.agent/windows/native/libdt_socket/socket_md.c Thu Feb 08 06:16:49 2018 -0800
+++ b/src/jdk.jdwp.agent/windows/native/libdt_socket/socket_md.c Thu Feb 08 06:19:24 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
*/
#include <windows.h>
#include <winsock2.h>
+#include <ws2tcpip.h>
#include "sysSocket.h"
#include "socketTransport.h"
@@ -197,9 +198,11 @@
return send(fd, buf, (int)nBytes, flags);
}
-struct hostent *
-dbgsysGetHostByName(char *hostname) {
- return gethostbyname(hostname);
+int
+dbgsysGetAddrInfo(char *hostname, char *service,
+ struct addrinfo *hints,
+ struct addrinfo **result) {
+ return getaddrinfo(hostname, service, hints, result);
}
unsigned short
@@ -223,7 +226,7 @@
if (getsockopt(fd, SOL_SOCKET, SO_LINGER, (char *)&l, &len) == 0) {
if (l.l_onoff == 0) {
- WSASendDisconnect(fd, NULL);
+ shutdown(fd, SD_SEND);
}
}
return closesocket(fd);
@@ -239,7 +242,11 @@
uint32_t
dbgsysInetAddr(const char* cp) {
- return (uint32_t)inet_addr(cp);
+ uint32_t addr;
+ if (inet_pton(AF_INET, cp, &addr) < 1) {
+ return -1;
+ }
+ return addr;
}
uint32_t
--- a/test/jdk/ProblemList.txt Thu Feb 08 06:16:49 2018 -0800
+++ b/test/jdk/ProblemList.txt Thu Feb 08 06:19:24 2018 -0800
@@ -341,6 +341,7 @@
java/nio/file/WatchService/Basic.java 7158947 solaris-all Solaris 11
java/nio/file/WatchService/MayFlies.java 7158947 solaris-all Solaris 11
+java/nio/file/WatchService/LotsOfCancels.java 8188039 solaris-all Solaris 11
java/nio/file/WatchService/LotsOfEvents.java 7158947 solaris-all Solaris 11
############################################################################