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) 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.
*
* 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
*/
void initChildStuff (int fdin, int fdout, ChildStuff *c) {
int n;
int argvBytes, nargv, envvBytes, nenvv;
int dirlen;
char *buf;
SpawnInfo sp;
int bufsize, offset=0;
@ -132,7 +129,6 @@ void initChildStuff (int fdin, int fdout, ChildStuff *c) {
int main(int argc, char *argv[]) {
ChildStuff c;
int t;
struct stat buf;
/* argv[0] contains the fd number to read all the child info */
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.
*
* 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)
{
int i, bytes, count;
int bytes, count;
const char * const *a = arg;
char *p;
int *q;
if (arg == 0) {
*nelems = 0;
*nbytes = 0;
@ -488,7 +486,6 @@ forkChild(ChildStuff *c) {
static pid_t
spawnChild(JNIEnv *env, jobject process, ChildStuff *c, const char *helperpath) {
pid_t resultPid;
jboolean isCopy;
int i, offset, rval, bufsize, magic;
char *buf, buf1[16];
char *hlpargs[2];

View file

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

View file

@ -353,7 +353,6 @@ java_props_t *
GetJavaProperties(JNIEnv *env)
{
static java_props_t sprops;
char *v; /* tmp var */
if (sprops.user_dir) {
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.
*
* This code is free software; you can redistribute it and/or modify it
@ -119,7 +119,6 @@ collapse(char *path)
int nc;
char **ix;
int i, j;
char *p, *q;
nc = collapsible(names);
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.
*
* 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 * jvmtype = NULL;
int argc = *pargc;
char **argv = *pargv;
#ifdef SETENV_REQUIRED

View file

@ -159,7 +159,6 @@ FindExecName(char *program)
/* relative path? */
if (JLI_StrRChr(program, FILE_SEPARATOR) != NULL) {
char buf[PATH_MAX+2];
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.
*
* 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) {
jstring jhost;
char *noproxyfor;
char *s;

View file

@ -81,8 +81,7 @@ lookupIfLocalhost(JNIEnv *env, const char *hostname, jboolean includeV6, int cha
jobjectArray result = NULL;
char myhostname[NI_MAXHOST + 1];
struct ifaddrs *ifa = NULL;
int familyOrder = 0;
int count = 0, i, j;
int i, j;
int addrs4 = 0, addrs6 = 0, numV4Loopbacks = 0, numV6Loopbacks = 0;
jboolean includeLoopback = JNI_FALSE;
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.
*
* 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 bindArr;
jobjectArray childArr;
netaddr *addrs;
jint addr_index, addr_count, bind_index;
jint child_count, child_index;
netaddr *addrP;
@ -902,7 +901,6 @@ static netif *enumInterfaces(JNIEnv *env) {
*/
static void freeif(netif *ifs) {
netif *currif = ifs;
netif *child = NULL;
while (currif != NULL) {
netaddr *addrP = currif->addr;

View file

@ -680,7 +680,6 @@ int
NET_Bind(int fd, SOCKETADDRESS *sa, int len)
{
int rv;
int arg, alen;
#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.
*/
sigset_t ss;
struct sigaction sa, osa;
sa.sa_handler = nullHandler;
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.
*
* 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,
jint opt, jint arg, jboolean isIPv6)
{
int result;
struct linger linger;
u_char carg;
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.
*
* 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;
socklen_t sa_len = sizeof(struct sockaddr_un);
int port;
if (getsockname(fdval(env, fdo), (struct sockaddr *)&sa, &sa_len) < 0) {
handleSocketError(env, errno);
return NULL;