mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8234629: remove unused functions from libnet
Reviewed-by: alanb, vtewari
This commit is contained in:
parent
f4fced0e24
commit
6eedae02a7
5 changed files with 2 additions and 92 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2004, 2019, 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
|
||||
|
@ -74,7 +74,6 @@ gconf_client_get_default_func* my_get_default_func = NULL;
|
|||
gconf_client_get_string_func* my_get_string_func = NULL;
|
||||
gconf_client_get_int_func* my_get_int_func = NULL;
|
||||
gconf_client_get_bool_func* my_get_bool_func = NULL;
|
||||
gconf_init_func* my_gconf_init_func = NULL;
|
||||
g_type_init_func* my_g_type_init_func = NULL;
|
||||
|
||||
|
||||
|
|
|
@ -73,50 +73,6 @@
|
|||
#define UDP_EXCLBIND 0x0101
|
||||
#endif
|
||||
|
||||
void setDefaultScopeID(JNIEnv *env, struct sockaddr *him)
|
||||
{
|
||||
#ifdef MACOSX
|
||||
static jclass ni_class = NULL;
|
||||
static jfieldID ni_defaultIndexID;
|
||||
if (ni_class == NULL) {
|
||||
jclass c = (*env)->FindClass(env, "java/net/NetworkInterface");
|
||||
CHECK_NULL(c);
|
||||
c = (*env)->NewGlobalRef(env, c);
|
||||
CHECK_NULL(c);
|
||||
ni_defaultIndexID = (*env)->GetStaticFieldID(env, c, "defaultIndex", "I");
|
||||
CHECK_NULL(ni_defaultIndexID);
|
||||
ni_class = c;
|
||||
}
|
||||
int defaultIndex;
|
||||
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)him;
|
||||
if (sin6->sin6_family == AF_INET6 && (sin6->sin6_scope_id == 0) &&
|
||||
(IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr) ||
|
||||
IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr))) {
|
||||
defaultIndex = (*env)->GetStaticIntField(env, ni_class,
|
||||
ni_defaultIndexID);
|
||||
sin6->sin6_scope_id = defaultIndex;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int getDefaultScopeID(JNIEnv *env) {
|
||||
int defaultIndex = 0;
|
||||
static jclass ni_class = NULL;
|
||||
static jfieldID ni_defaultIndexID;
|
||||
if (ni_class == NULL) {
|
||||
jclass c = (*env)->FindClass(env, "java/net/NetworkInterface");
|
||||
CHECK_NULL_RETURN(c, 0);
|
||||
c = (*env)->NewGlobalRef(env, c);
|
||||
CHECK_NULL_RETURN(c, 0);
|
||||
ni_defaultIndexID = (*env)->GetStaticFieldID(env, c, "defaultIndex", "I");
|
||||
CHECK_NULL_RETURN(ni_defaultIndexID, 0);
|
||||
ni_class = c;
|
||||
}
|
||||
defaultIndex = (*env)->GetStaticIntField(env, ni_class,
|
||||
ni_defaultIndexID);
|
||||
return defaultIndex;
|
||||
}
|
||||
|
||||
#define RESTARTABLE(_cmd, _result) do { \
|
||||
do { \
|
||||
_result = _cmd; \
|
||||
|
@ -217,26 +173,6 @@ static int findMaxBuf(int fd, int opt, int sotype) {
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
static int vinit = 0;
|
||||
static int kernelV24 = 0;
|
||||
static int vinit24 = 0;
|
||||
|
||||
int kernelIsV24 () {
|
||||
if (!vinit24) {
|
||||
struct utsname sysinfo;
|
||||
if (uname(&sysinfo) == 0) {
|
||||
sysinfo.release[3] = '\0';
|
||||
if (strcmp(sysinfo.release, "2.4") == 0) {
|
||||
kernelV24 = JNI_TRUE;
|
||||
}
|
||||
}
|
||||
vinit24 = 1;
|
||||
}
|
||||
return kernelV24;
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
NET_ThrowByNameWithLastError(JNIEnv *env, const char *name,
|
||||
const char *defaultDetail) {
|
||||
|
|
|
@ -98,10 +98,6 @@ void NET_ThrowByNameWithLastError(JNIEnv *env, const char *name,
|
|||
const char *defaultDetail);
|
||||
void NET_SetTrafficClass(SOCKETADDRESS *sa, int trafficClass);
|
||||
|
||||
#ifdef __linux__
|
||||
int kernelIsV24();
|
||||
#endif
|
||||
|
||||
#ifdef __solaris__
|
||||
int net_getParam(char *driver, char *param);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue