8289768: Clean up unused code

Reviewed-by: dfuchs, lancea, weijun, naoto, cjplummer, alanb, michaelm, chegar
This commit is contained in:
Daniel Jeliński 2022-07-12 11:30:17 +00:00
parent 3b9059a147
commit 04c47da118
46 changed files with 29 additions and 98 deletions

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -237,9 +237,9 @@ static uid_t getUID(pid_t pid) {
* into the Info object. * into the Info object.
*/ */
void os_getCmdlineAndUserInfo(JNIEnv *env, jobject jinfo, pid_t pid) { void os_getCmdlineAndUserInfo(JNIEnv *env, jobject jinfo, pid_t pid) {
int mib[3], maxargs, nargs, i; int mib[3], maxargs, nargs;
size_t size; size_t size;
char *args, *cp, *sp, *np; char *args, *cp;
// Get the UID first. This is done here because it is cheap to do it here // Get the UID first. This is done here because it is cheap to do it here
// on other platforms like Linux/Solaris/AIX where the uid comes from the // on other platforms like Linux/Solaris/AIX where the uid comes from the

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -362,8 +362,6 @@ CreateExecutionEnvironment(int *pargc, char ***pargv,
char jrepath[], jint so_jrepath, char jrepath[], jint so_jrepath,
char jvmpath[], jint so_jvmpath, char jvmpath[], jint so_jvmpath,
char jvmcfg[], jint so_jvmcfg) { char jvmcfg[], jint so_jvmcfg) {
jboolean jvmpathExists;
/* Compute/set the name of the executable */ /* Compute/set the name of the executable */
SetExecname(*pargv); SetExecname(*pargv);
@ -547,7 +545,6 @@ GetJREPath(char *path, jint pathsize, jboolean speculative)
jboolean jboolean
LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn) LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn)
{ {
Dl_info dlinfo;
void *libjvm; void *libjvm;
JLI_TraceLauncher("JVM path is %s\n", jvmpath); JLI_TraceLauncher("JVM path is %s\n", jvmpath);

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017 SAP SE. All rights reserved. * Copyright (c) 2017 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
@ -168,7 +168,6 @@ Java_sun_net_spi_DefaultProxySelector_getSystemProxies(JNIEnv *env,
{ {
CFDictionaryRef proxyDicRef = NULL; CFDictionaryRef proxyDicRef = NULL;
CFURLRef urlRef = NULL; CFURLRef urlRef = NULL;
bool proxyFound = false;
jobjectArray proxyArray = NULL; jobjectArray proxyArray = NULL;
const char *cproto; const char *cproto;
const char *chost; const char *chost;

View file

@ -147,7 +147,6 @@ Java_sun_nio_fs_BsdNativeDispatcher_fsstatEntry(JNIEnv* env, jclass this,
char* dir; char* dir;
char* fstype; char* fstype;
char* options; char* options;
dev_t dev;
if (iter == NULL || iter->pos >= iter->nentries) if (iter == NULL || iter->pos >= iter->nentries)
return -1; return -1;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -62,7 +62,6 @@ static const char** const_extra_jargs = NULL;
static const char* const_progname = "java"; static const char* const_progname = "java";
static const char** const_jargs = NULL; static const char** const_jargs = NULL;
static const char** const_extra_jargs = NULL; static const char** const_extra_jargs = NULL;
static const char* const_appclasspath[] = { NULL };
#endif /* JAVA_ARGS */ #endif /* JAVA_ARGS */
#ifdef LAUNCHER_NAME #ifdef LAUNCHER_NAME

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -191,7 +191,6 @@ JNIEXPORT void JNICALL
Java_jdk_internal_loader_NativeLibraries_unload Java_jdk_internal_loader_NativeLibraries_unload
(JNIEnv *env, jclass cls, jstring name, jboolean isBuiltin, jlong address) (JNIEnv *env, jclass cls, jstring name, jboolean isBuiltin, jlong address)
{ {
const char *onUnloadSymbols[] = JNI_ONUNLOAD_SYMBOLS;
void *handle; void *handle;
JNI_OnUnload_t JNI_OnUnload; JNI_OnUnload_t JNI_OnUnload;
const char *cname; const char *cname;
@ -254,7 +253,6 @@ Java_jdk_internal_loader_NativeLibraries_findBuiltinLib
size_t len; size_t len;
jstring lib; jstring lib;
void *ret; void *ret;
const char *onLoadSymbols[] = JNI_ONLOAD_SYMBOLS;
if (name == NULL) { if (name == NULL) {
JNU_ThrowInternalError(env, "NULL filename for native library"); JNU_ThrowInternalError(env, "NULL filename for native library");

View file

@ -966,13 +966,9 @@ SelectVersion(int argc, char **argv, char **main_class)
{ {
char *arg; char *arg;
char *operand; char *operand;
char *version = NULL;
char *jre = NULL;
int jarflag = 0; int jarflag = 0;
int headlessflag = 0; int headlessflag = 0;
int restrict_search = -1; /* -1 implies not known */
manifest_info info; manifest_info info;
char env_entry[MAXNAMELEN + 24] = ENV_ENTRY "=";
char *splash_file_name = NULL; char *splash_file_name = NULL;
char *splash_jar_name = NULL; char *splash_jar_name = NULL;
char *env_in; char *env_in;
@ -2007,7 +2003,6 @@ ReadKnownVMs(const char *jvmCfgName, jboolean speculative)
int vmType; int vmType;
char *tmpPtr; char *tmpPtr;
char *altVMName = NULL; char *altVMName = NULL;
char *serverClassVMName = NULL;
static char *whiteSpace = " \t"; static char *whiteSpace = " \t";
if (JLI_IsTraceLauncher()) { if (JLI_IsTraceLauncher()) {
start = CurrentTimeMicros(); start = CurrentTimeMicros();

View file

@ -583,7 +583,6 @@ JLI_ParseManifest(char *jarfile, manifest_info *info)
char *name; char *name;
char *value; char *value;
int rc; int rc;
char *splashscreen_name = NULL;
if ((fd = JLI_Open(jarfile, O_RDONLY if ((fd = JLI_Open(jarfile, O_RDONLY
#ifdef O_LARGEFILE #ifdef O_LARGEFILE

View file

@ -1861,7 +1861,6 @@ run_dataflow(context_type *context) {
work_to_do = JNI_TRUE; work_to_do = JNI_TRUE;
#ifdef DEBUG #ifdef DEBUG
if (verify_verbose) { if (verify_verbose) {
int opcode = this_idata->opcode;
jio_fprintf(stdout, "Instruction %d: ", inumber); jio_fprintf(stdout, "Instruction %d: ", inumber);
print_stack(context, &this_idata->stack_info); print_stack(context, &this_idata->stack_info);
print_registers(context, &this_idata->register_info); print_registers(context, &this_idata->register_info);

View file

@ -1552,7 +1552,6 @@ JNIEXPORT jboolean
ZIP_InflateFully(void *inBuf, jlong inLen, void *outBuf, jlong outLen, char **pmsg) ZIP_InflateFully(void *inBuf, jlong inLen, void *outBuf, jlong outLen, char **pmsg)
{ {
z_stream strm; z_stream strm;
int i = 0;
memset(&strm, 0, sizeof(z_stream)); memset(&strm, 0, sizeof(z_stream));
*pmsg = 0; /* Reset error message */ *pmsg = 0; /* Reset error message */

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -71,9 +71,6 @@ void shutItDown() {
* - the data strings for fields in ChildStuff * - the data strings for fields in ChildStuff
*/ */
void initChildStuff (int fdin, int fdout, ChildStuff *c) { void initChildStuff (int fdin, int fdout, ChildStuff *c) {
int n;
int argvBytes, nargv, envvBytes, nenvv;
int dirlen;
char *buf; char *buf;
SpawnInfo sp; SpawnInfo sp;
int bufsize, offset=0; int bufsize, offset=0;
@ -132,7 +129,6 @@ void initChildStuff (int fdin, int fdout, ChildStuff *c) {
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
ChildStuff c; ChildStuff c;
int t;
struct stat buf; struct stat buf;
/* argv[0] contains the fd number to read all the child info */ /* argv[0] contains the fd number to read all the child info */
int r, fdin, fdout; int r, fdin, fdout;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1995, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -399,10 +399,8 @@ copyPipe(int from[2], int to[2])
*/ */
static void arraysize(const char * const *arg, int *nelems, int *nbytes) static void arraysize(const char * const *arg, int *nelems, int *nbytes)
{ {
int i, bytes, count; int bytes, count;
const char * const *a = arg; const char * const *a = arg;
char *p;
int *q;
if (arg == 0) { if (arg == 0) {
*nelems = 0; *nelems = 0;
*nbytes = 0; *nbytes = 0;
@ -488,7 +486,6 @@ forkChild(ChildStuff *c) {
static pid_t static pid_t
spawnChild(JNIEnv *env, jobject process, ChildStuff *c, const char *helperpath) { spawnChild(JNIEnv *env, jobject process, ChildStuff *c, const char *helperpath) {
pid_t resultPid; pid_t resultPid;
jboolean isCopy;
int i, offset, rval, bufsize, magic; int i, offset, rval, bufsize, magic;
char *buf, buf1[16]; char *buf, buf1[16];
char *hlpargs[2]; char *hlpargs[2];

View file

@ -151,7 +151,6 @@ findZoneinfoFile(char *buf, size_t size, const char *dir)
struct dirent *dp = NULL; struct dirent *dp = NULL;
char *pathname = NULL; char *pathname = NULL;
char *tz = NULL; char *tz = NULL;
int res;
if (strcmp(dir, ZONEINFO_DIR) == 0) { if (strcmp(dir, ZONEINFO_DIR) == 0) {
/* fast path for 1st iteration */ /* fast path for 1st iteration */

View file

@ -353,7 +353,6 @@ java_props_t *
GetJavaProperties(JNIEnv *env) GetJavaProperties(JNIEnv *env)
{ {
static java_props_t sprops; static java_props_t sprops;
char *v; /* tmp var */
if (sprops.user_dir) { if (sprops.user_dir) {
return &sprops; return &sprops;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -119,7 +119,6 @@ collapse(char *path)
int nc; int nc;
char **ix; char **ix;
int i, j; int i, j;
char *p, *q;
nc = collapsible(names); nc = collapsible(names);
if (nc < 2) return; /* Nothing to do */ if (nc < 2) return; /* Nothing to do */

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -298,7 +298,6 @@ CreateExecutionEnvironment(int *pargc, char ***pargv,
char jvmcfg[], jint so_jvmcfg) { char jvmcfg[], jint so_jvmcfg) {
char * jvmtype = NULL; char * jvmtype = NULL;
int argc = *pargc;
char **argv = *pargv; char **argv = *pargv;
#ifdef SETENV_REQUIRED #ifdef SETENV_REQUIRED

View file

@ -159,7 +159,6 @@ FindExecName(char *program)
/* relative path? */ /* relative path? */
if (JLI_StrRChr(program, FILE_SEPARATOR) != NULL) { if (JLI_StrRChr(program, FILE_SEPARATOR) != NULL) {
char buf[PATH_MAX+2];
return Resolve(getcwd(cwdbuf, sizeof(cwdbuf)), program); return Resolve(getcwd(cwdbuf, sizeof(cwdbuf)), program);
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2004, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -237,7 +237,6 @@ static jobjectArray getProxyByGConf(JNIEnv *env, const char* cproto,
} }
if (use_proxy) { if (use_proxy) {
jstring jhost;
char *noproxyfor; char *noproxyfor;
char *s; char *s;

View file

@ -81,8 +81,7 @@ lookupIfLocalhost(JNIEnv *env, const char *hostname, jboolean includeV6, int cha
jobjectArray result = NULL; jobjectArray result = NULL;
char myhostname[NI_MAXHOST + 1]; char myhostname[NI_MAXHOST + 1];
struct ifaddrs *ifa = NULL; struct ifaddrs *ifa = NULL;
int familyOrder = 0; int i, j;
int count = 0, i, j;
int addrs4 = 0, addrs6 = 0, numV4Loopbacks = 0, numV6Loopbacks = 0; int addrs4 = 0, addrs6 = 0, numV4Loopbacks = 0, numV6Loopbacks = 0;
jboolean includeLoopback = JNI_FALSE; jboolean includeLoopback = JNI_FALSE;
jobject name; jobject name;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -704,7 +704,6 @@ static jobject createNetworkInterface(JNIEnv *env, netif *ifs) {
jobjectArray addrArr; jobjectArray addrArr;
jobjectArray bindArr; jobjectArray bindArr;
jobjectArray childArr; jobjectArray childArr;
netaddr *addrs;
jint addr_index, addr_count, bind_index; jint addr_index, addr_count, bind_index;
jint child_count, child_index; jint child_count, child_index;
netaddr *addrP; netaddr *addrP;
@ -902,7 +901,6 @@ static netif *enumInterfaces(JNIEnv *env) {
*/ */
static void freeif(netif *ifs) { static void freeif(netif *ifs) {
netif *currif = ifs; netif *currif = ifs;
netif *child = NULL;
while (currif != NULL) { while (currif != NULL) {
netaddr *addrP = currif->addr; netaddr *addrP = currif->addr;

View file

@ -680,7 +680,6 @@ int
NET_Bind(int fd, SOCKETADDRESS *sa, int len) NET_Bind(int fd, SOCKETADDRESS *sa, int len)
{ {
int rv; int rv;
int arg, alen;
#ifdef __linux__ #ifdef __linux__
/* /*

View file

@ -62,7 +62,6 @@ Java_sun_nio_ch_NativeThread_init(JNIEnv *env, jclass cl)
* should somehow be unified, perhaps within the VM. * should somehow be unified, perhaps within the VM.
*/ */
sigset_t ss;
struct sigaction sa, osa; struct sigaction sa, osa;
sa.sa_handler = nullHandler; sa.sa_handler = nullHandler;
sa.sa_flags = 0; sa.sa_flags = 0;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -529,7 +529,6 @@ Java_sun_nio_ch_Net_setIntOption0(JNIEnv *env, jclass clazz, jobject fdo,
jboolean mayNeedConversion, jint level, jboolean mayNeedConversion, jint level,
jint opt, jint arg, jboolean isIPv6) jint opt, jint arg, jboolean isIPv6)
{ {
int result;
struct linger linger; struct linger linger;
u_char carg; u_char carg;
void *parg; void *parg;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -184,7 +184,6 @@ Java_sun_nio_ch_UnixDomainSockets_localAddress0(JNIEnv *env, jclass clazz, jobje
{ {
struct sockaddr_un sa; struct sockaddr_un sa;
socklen_t sa_len = sizeof(struct sockaddr_un); socklen_t sa_len = sizeof(struct sockaddr_un);
int port;
if (getsockname(fdval(env, fdo), (struct sockaddr *)&sa, &sa_len) < 0) { if (getsockname(fdval(env, fdo), (struct sockaddr *)&sa, &sa_len) < 0) {
handleSocketError(env, errno); handleSocketError(env, errno);
return NULL; return NULL;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -417,7 +417,6 @@ Java_java_lang_ProcessHandleImpl_00024Info_info0(JNIEnv *env,
jobject jinfo, jobject jinfo,
jlong jpid) { jlong jpid) {
DWORD pid = (DWORD)jpid; DWORD pid = (DWORD)jpid;
int ret = 0;
HANDLE handle = HANDLE handle =
OpenProcess(THREAD_QUERY_INFORMATION | PROCESS_QUERY_LIMITED_INFORMATION, OpenProcess(THREAD_QUERY_INFORMATION | PROCESS_QUERY_LIMITED_INFORMATION,
FALSE, pid); FALSE, pid);

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -406,7 +406,6 @@ static int getWinTimeZone(char *winZoneName)
static char *matchJavaTZ(const char *java_home_dir, char *tzName) static char *matchJavaTZ(const char *java_home_dir, char *tzName)
{ {
int line; int line;
int IDmatched = 0;
FILE *fp; FILE *fp;
char *javaTZName = NULL; char *javaTZName = NULL;
char *items[TZ_NITEMS]; char *items[TZ_NITEMS];

View file

@ -100,7 +100,6 @@ currentDirLength(const WCHAR* ps, int pathlen) {
static int curDirLenCached = -1; static int curDirLenCached = -1;
//relative to both drive and directory //relative to both drive and directory
if (curDirLenCached == -1) { if (curDirLenCached == -1) {
int dirlen = -1;
dir = _wgetcwd(NULL, MAX_PATH); dir = _wgetcwd(NULL, MAX_PATH);
if (dir != NULL) { if (dir != NULL) {
curDirLenCached = (int)wcslen(dir); curDirLenCached = (int)wcslen(dir);
@ -180,7 +179,6 @@ pathToNTPath(JNIEnv *env, jstring path, jboolean throwFNFE) {
(therefore allocate the sufficient memory block) before calling (therefore allocate the sufficient memory block) before calling
_wfullpath(), we have to get the length of "current" dir first. _wfullpath(), we have to get the length of "current" dir first.
*/ */
WCHAR *abpath = NULL;
int dirlen = currentDirLength(ps, pathlen); int dirlen = currentDirLength(ps, pathlen);
if (dirlen + pathlen + 1 > max_path - 1) { if (dirlen + pathlen + 1 > max_path - 1) {
pathbuf = prefixAbpath(ps, pathlen, dirlen + pathlen); pathbuf = prefixAbpath(ps, pathlen, dirlen + pathlen);

View file

@ -546,8 +546,6 @@ static errno_t convert_to_unicode(const char* path, const wchar_t* prefix, wchar
*/ */
static wchar_t* create_unc_path(const char* path, errno_t* err) { static wchar_t* create_unc_path(const char* path, errno_t* err) {
wchar_t* wpath = NULL; wchar_t* wpath = NULL;
size_t converted_chars = 0;
size_t path_len = strlen(path) + 1; /* includes the terminating NULL */
if (path[0] == '\\' && path[1] == '\\') { if (path[0] == '\\' && path[1] == '\\') {
if (path[2] == '?' && path[3] == '\\') { if (path[2] == '?' && path[3] == '\\') {
/* if it already has a \\?\ don't do the prefix */ /* if it already has a \\?\ don't do the prefix */

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -834,7 +834,6 @@ JNIEXPORT jobject JNICALL Java_java_net_NetworkInterface_getByIndex0
JNIEXPORT jboolean JNICALL Java_java_net_NetworkInterface_boundInetAddress0 JNIEXPORT jboolean JNICALL Java_java_net_NetworkInterface_boundInetAddress0
(JNIEnv *env, jclass cls, jobject iaObj) (JNIEnv *env, jclass cls, jobject iaObj)
{ {
jobject netifObj = NULL;
DWORD i; DWORD i;
int family = getInetAddress_family(env, iaObj); int family = getInetAddress_family(env, iaObj);

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -643,7 +643,6 @@ JNIEXPORT jint JNICALL
Java_sun_nio_ch_Net_poll(JNIEnv* env, jclass this, jobject fdo, jint events, jlong timeout) Java_sun_nio_ch_Net_poll(JNIEnv* env, jclass this, jobject fdo, jint events, jlong timeout)
{ {
int rv; int rv;
int revents = 0;
struct timeval t; struct timeval t;
fd_set rd, wr, ex; fd_set rd, wr, ex;
jint fd = fdval(env, fdo); jint fd = fdval(env, fdo);

View file

@ -683,7 +683,6 @@ Java_sun_nio_fs_WindowsNativeDispatcher_SetFileSecurity0(JNIEnv* env, jclass thi
{ {
LPCWSTR lpFileName = jlong_to_ptr(pathAddress); LPCWSTR lpFileName = jlong_to_ptr(pathAddress);
PSECURITY_DESCRIPTOR pSecurityDescriptor = jlong_to_ptr(descAddress); PSECURITY_DESCRIPTOR pSecurityDescriptor = jlong_to_ptr(descAddress);
DWORD lengthNeeded = 0;
BOOL res = SetFileSecurityW(lpFileName, BOOL res = SetFileSecurityW(lpFileName,
(SECURITY_INFORMATION)requestedInformation, (SECURITY_INFORMATION)requestedInformation,
@ -1256,7 +1255,6 @@ Java_sun_nio_fs_WindowsNativeDispatcher_ReadDirectoryChangesW(JNIEnv* env, jclas
{ {
BOOL res; BOOL res;
BOOL subtree = (watchSubTree == JNI_TRUE) ? TRUE : FALSE; BOOL subtree = (watchSubTree == JNI_TRUE) ? TRUE : FALSE;
LPOVERLAPPED ov = (LPOVERLAPPED)jlong_to_ptr(pOverlapped);
res = ReadDirectoryChangesW((HANDLE)jlong_to_ptr(hDirectory), res = ReadDirectoryChangesW((HANDLE)jlong_to_ptr(hDirectory),
(LPVOID)jlong_to_ptr(bufferAddress), (LPVOID)jlong_to_ptr(bufferAddress),

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2004, 2020, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2004, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -199,7 +199,6 @@ static char* normalizePath(const char* path, int len, int off) {
char* normalize(char* path) { char* normalize(char* path) {
int n = (int)strlen(path); int n = (int)strlen(path);
int i; int i;
char c = 0;
int prev = 0; int prev = 0;
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
char c = path[i]; char c = path[i];

View file

@ -48,7 +48,6 @@ Java_sun_security_jgss_wrapper_GSSLibStub_init(JNIEnv *env,
jboolean jDebug) { jboolean jDebug) {
const char *libName; const char *libName;
int failed; int failed;
char *error = NULL;
if (!jDebug) { if (!jDebug) {
JGSS_DEBUG = 0; JGSS_DEBUG = 0;

View file

@ -736,8 +736,6 @@ gss_acquire_cred(OM_uint32 *minor_status,
PP("Cannot get owner name of default creds"); PP("Cannot get owner name of default creds");
goto err; goto err;
} }
SEC_WCHAR* rnames = realname->name;
SEC_WCHAR* dnames = desired_name->name;
int equals = 0; int equals = 0;
gss_compare_name(minor_status, realname, desired_name, &equals); gss_compare_name(minor_status, realname, desired_name, &equals);
gss_release_name(minor_status, &realname); gss_release_name(minor_status, &realname);

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
*/ */
/* Copyright (c) 2002 Graz University of Technology. All rights reserved. /* Copyright (c) 2002 Graz University of Technology. All rights reserved.
@ -156,7 +156,6 @@ Java_sun_security_pkcs11_wrapper_PKCS11_getNativeKeyInfo
jbyte* nativeKeyInfoArrayRawCkAttributesPtr = NULL; jbyte* nativeKeyInfoArrayRawCkAttributesPtr = NULL;
jbyte* nativeKeyInfoArrayRawDataPtr = NULL; jbyte* nativeKeyInfoArrayRawDataPtr = NULL;
CK_MECHANISM_PTR ckpMechanism = NULL; CK_MECHANISM_PTR ckpMechanism = NULL;
char iv[16] = {0x0};
CK_ULONG ckWrappedKeyLength = 0U; CK_ULONG ckWrappedKeyLength = 0U;
jbyte* wrappedKeySizeWrappedKeyArrayPtr = NULL; jbyte* wrappedKeySizeWrappedKeyArrayPtr = NULL;
CK_BYTE_PTR wrappedKeyBufferPtr = NULL; CK_BYTE_PTR wrappedKeyBufferPtr = NULL;
@ -419,7 +418,6 @@ Java_sun_security_pkcs11_wrapper_PKCS11_createNativeKey
jbyte* wrappedKeySizePtr = NULL; jbyte* wrappedKeySizePtr = NULL;
unsigned int i = 0U; unsigned int i = 0U;
CK_MECHANISM_PTR ckpMechanism = NULL; CK_MECHANISM_PTR ckpMechanism = NULL;
char iv[16] = {0x0};
CK_ULONG ckWrappedKeyLength = 0UL; CK_ULONG ckWrappedKeyLength = 0UL;
CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj); CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj);

View file

@ -79,7 +79,6 @@ JNIEXPORT jobject JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_connect
jstring jGetFunctionList) { jstring jGetFunctionList) {
void *hModule; void *hModule;
char *error;
int i; int i;
CK_ULONG ulCount = 0; CK_ULONG ulCount = 0;
CK_C_GetInterfaceList C_GetInterfaceList = NULL; CK_C_GetInterfaceList C_GetInterfaceList = NULL;

View file

@ -2562,7 +2562,6 @@ JNIEXPORT jobject JNICALL Java_sun_security_mscapi_CKeyStore_storePrivateKey
JNIEXPORT jobject JNICALL Java_sun_security_mscapi_CSignature_importECPublicKey JNIEXPORT jobject JNICALL Java_sun_security_mscapi_CSignature_importECPublicKey
(JNIEnv *env, jclass clazz, jstring alg, jbyteArray keyBlob, jint keySize) (JNIEnv *env, jclass clazz, jstring alg, jbyteArray keyBlob, jint keySize)
{ {
BCRYPT_ALG_HANDLE hSignAlg = NULL;
NCRYPT_KEY_HANDLE hTmpKey = NULL; NCRYPT_KEY_HANDLE hTmpKey = NULL;
DWORD dwBlobLen; DWORD dwBlobLen;
BYTE * pbKeyBlob = NULL; BYTE * pbKeyBlob = NULL;

View file

@ -352,7 +352,6 @@ extern "C"
JNIEXPORT jlong JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal_lookupByName0 JNIEXPORT jlong JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal_lookupByName0
(JNIEnv *env, jobject this_obj, jstring objectName, jstring symbolName) { (JNIEnv *env, jobject this_obj, jstring objectName, jstring symbolName) {
jlong addr; jlong addr;
jboolean isCopy;
struct ps_prochandle* ph = get_proc_handle(env, this_obj); struct ps_prochandle* ph = get_proc_handle(env, this_obj);
// Note, objectName is ignored, and may in fact be NULL. // Note, objectName is ignored, and may in fact be NULL.
// lookup_symbol will always search all objects/libs // lookup_symbol will always search all objects/libs

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -220,7 +220,6 @@ bool read_eh_frame(struct ps_prochandle* ph, lib_info* lib) {
ELF_SHDR* shbuf = NULL; ELF_SHDR* shbuf = NULL;
ELF_SHDR* sh = NULL; ELF_SHDR* sh = NULL;
char* strtab = NULL; char* strtab = NULL;
void* result = NULL;
int cnt; int cnt;
current_pos = lseek(lib->fd, (off_t)0L, SEEK_CUR); current_pos = lseek(lib->fd, (off_t)0L, SEEK_CUR);

View file

@ -729,7 +729,6 @@ JNIEXPORT struct ps_prochandle* JNICALL
Pgrab_core(const char* exec_file, const char* core_file) { Pgrab_core(const char* exec_file, const char* core_file) {
ELF_EHDR core_ehdr; ELF_EHDR core_ehdr;
ELF_EHDR exec_ehdr; ELF_EHDR exec_ehdr;
ELF_EHDR lib_ehdr;
struct ps_prochandle* ph = (struct ps_prochandle*) calloc(1, sizeof(struct ps_prochandle)); struct ps_prochandle* ph = (struct ps_prochandle*) calloc(1, sizeof(struct ps_prochandle));
if (ph == NULL) { if (ph == NULL) {

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -292,7 +292,6 @@ static struct symtab* build_symtab_from_build_id(Elf64_Nhdr *note)
// try to open an associated debuginfo file // try to open an associated debuginfo file
static struct symtab* build_symtab_internal(int fd, const char *filename, bool try_debuginfo) { static struct symtab* build_symtab_internal(int fd, const char *filename, bool try_debuginfo) {
ELF_EHDR ehdr; ELF_EHDR ehdr;
char *names = NULL;
struct symtab* symtab = NULL; struct symtab* symtab = NULL;
// Reading of elf header // Reading of elf header
@ -306,8 +305,6 @@ static struct symtab* build_symtab_internal(int fd, const char *filename, bool t
int cnt = 0; int cnt = 0;
ELF_SHDR* shbuf = NULL; ELF_SHDR* shbuf = NULL;
ELF_SHDR* cursct = NULL; ELF_SHDR* cursct = NULL;
ELF_PHDR* phbuf = NULL;
ELF_PHDR* phdr = NULL;
int sym_section = SHT_DYNSYM; int sym_section = SHT_DYNSYM;
uintptr_t baseaddr = (uintptr_t)-1; uintptr_t baseaddr = (uintptr_t)-1;
@ -502,7 +499,6 @@ bad:
quit: quit:
if (shbuf) free(shbuf); if (shbuf) free(shbuf);
if (phbuf) free(phbuf);
if (scn_cache) { if (scn_cache) {
for (cnt = 0; cnt < ehdr.e_shnum; cnt++) { for (cnt = 0; cnt < ehdr.e_shnum; cnt++) {
if (scn_cache[cnt].c_data != NULL) { if (scn_cache[cnt].c_data != NULL) {
@ -550,7 +546,6 @@ uintptr_t search_symbol(struct symtab* symtab, uintptr_t base,
return rslt; return rslt;
} }
quit:
free(item.key); free(item.key);
return (uintptr_t) NULL; return (uintptr_t) NULL;
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -247,7 +247,6 @@ struct symtab* build_symtab(int fd) {
int cnt = 0; int cnt = 0;
ELF_SHDR* shbuf = NULL; ELF_SHDR* shbuf = NULL;
ELF_SHDR* cursct = NULL; ELF_SHDR* cursct = NULL;
ELF_PHDR* phbuf = NULL;
int symtab_found = 0; int symtab_found = 0;
int dynsym_found = 0; int dynsym_found = 0;
uint32_t symsection = SHT_SYMTAB; uint32_t symsection = SHT_SYMTAB;
@ -372,7 +371,6 @@ bad:
quit: quit:
if (shbuf) free(shbuf); if (shbuf) free(shbuf);
if (phbuf) free(phbuf);
if (scn_cache) { if (scn_cache) {
for (cnt = 0; cnt < ehdr.e_shnum; cnt++) { for (cnt = 0; cnt < ehdr.e_shnum; cnt++) {
if (scn_cache[cnt].c_data != NULL) { if (scn_cache[cnt].c_data != NULL) {

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -185,7 +185,6 @@ JNIEXPORT jlong JNICALL Java_com_sun_tools_jdi_SharedMemoryTransportService_star
{ {
const char *addrChars = NULL; const char *addrChars = NULL;
jint rc; jint rc;
jstring retAddress = NULL;
SharedMemoryTransport *transport = NULL; SharedMemoryTransport *transport = NULL;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -224,8 +224,6 @@ void
setup_logging(const char *filename, unsigned flags) setup_logging(const char *filename, unsigned flags)
{ {
#ifdef JDWP_LOGGING #ifdef JDWP_LOGGING
FILE *fp = NULL;
/* Turn off logging */ /* Turn off logging */
logging = 0; logging = 0;
gdata->log_flags = 0; gdata->log_flags = 0;

View file

@ -87,7 +87,6 @@ static jlong page_size = 0;
static jlong get_total_or_available_swap_space_size(JNIEnv* env, jboolean available) { static jlong get_total_or_available_swap_space_size(JNIEnv* env, jboolean available) {
#if defined(__linux__) #if defined(__linux__)
int ret; int ret;
FILE *fp;
jlong total = 0, avail = 0; jlong total = 0, avail = 0;
struct sysinfo si; struct sysinfo si;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2009, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2009, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -496,7 +496,6 @@ int mapSocketOption
JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpNet_setIntOption0 JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpNet_setIntOption0
(JNIEnv *env, jclass klass, jint fd, jint opt, int arg) { (JNIEnv *env, jclass klass, jint fd, jint opt, int arg) {
int klevel, kopt; int klevel, kopt;
int result;
struct linger linger; struct linger linger;
void *parg; void *parg;
int arglen; int arglen;