8251546: 8u backport of JDK-8194298 breaks AIX and Solaris builds

Wed, 19 Aug 2020 18:01:24 +0200

author
sgehwolf
date
Wed, 19 Aug 2020 18:01:24 +0200
changeset 14168
8a367e717840
parent 14167
3f6ca2dd1b23
child 14169
edb84bd2f10f

8251546: 8u backport of JDK-8194298 breaks AIX and Solaris builds
Reviewed-by: shade

src/solaris/native/java/net/ExtendedOptionsImpl.c file | annotate | diff | comparison | revisions
     1.1 --- a/src/solaris/native/java/net/ExtendedOptionsImpl.c	Thu Mar 21 14:40:04 2019 -0400
     1.2 +++ b/src/solaris/native/java/net/ExtendedOptionsImpl.c	Wed Aug 19 18:01:24 2020 +0200
     1.3 @@ -332,6 +332,8 @@
     1.4      return JNI_FALSE;
     1.5  }
     1.6  
     1.7 +#endif /* __solaris__ */
     1.8 +
     1.9  // Keep alive options are available for MACOSX and Linux only for
    1.10  // the time being.
    1.11  #if defined(__linux__) || defined(MACOSX)
    1.12 @@ -407,6 +409,18 @@
    1.13  
    1.14  #else /* __linux__ || MACOSX */
    1.15  
    1.16 +// On AIX and Solaris these constants aren't defined. Map them to a
    1.17 +// value so that the code below compiles. Values aren't used as
    1.18 +// on those platforms UnsupportedOperationException will be thrown
    1.19 +// instead.
    1.20 +#define SOCK_OPT_LEVEL -1
    1.21 +#define SOCK_OPT_NAME_KEEPIDLE -1
    1.22 +#define SOCK_OPT_NAME_KEEPIDLE_STR "TCP_KEEPIDLE"
    1.23 +#define TCP_KEEPCNT -1
    1.24 +#define TCP_KEEPINTVL -1
    1.25 +#define SOCK_OPT_LEVEL -1
    1.26 +#define SOCK_OPT_NAME_KEEPIDLE -1
    1.27 +
    1.28  /* Keep alive options not supported for non-linux/non-macosx so throw UnsupportedOpExc */
    1.29  
    1.30  static void setTcpSocketOption
    1.31 @@ -423,8 +437,6 @@
    1.32  
    1.33  #endif /* __linux__ || MACOSX*/
    1.34  
    1.35 -#endif /* __solaris__ */
    1.36 -
    1.37  JNIEXPORT jboolean JNICALL Java_sun_net_ExtendedOptionsImpl_flowSupported
    1.38    (JNIEnv *env, jclass UNUSED) {
    1.39      return flowSupported0();

mercurial