Skip to content

Commit

Permalink
Remove unnecessary references to J9ZOS390 in z/OS specific files
Browse files Browse the repository at this point in the history
Signed-off-by: Devin Nakamura <[email protected]>
  • Loading branch information
dnakamura authored and fjeremic committed Jun 4, 2019
1 parent b7ecc9a commit a49da9d
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 62 deletions.
10 changes: 5 additions & 5 deletions port/zos390/omrgetjobname.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,19 @@ omrget_jobname(struct OMRPortLibrary *portLibrary, char *jobname, uintptr_t leng
if (tmp_jobname) {
memset(tmp_jobname, '\0', J9_MAX_JOBNAME);
_JOBNAME(tmp_jobname); /* requires <31bit address */
#if defined(J9ZOS390) && !defined(OMR_EBCDIC)
#if !defined(OMR_EBCDIC)
ascname = e2a_func(tmp_jobname, strlen(tmp_jobname));
#else /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#else /* !defined(OMR_EBCDIC) */
ascname = tmp_jobname;
#endif /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#endif /* !defined(OMR_EBCDIC) */

if (ascname) {
width = strcspn(ascname, " ");
strncpy(jobname, ascname, width);
jobname[width] = '\0';
#if defined(J9ZOS390) && !defined(OMR_EBCDIC)
#if !defined(OMR_EBCDIC)
free(ascname);
#endif /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#endif /* !defined(OMR_EBCDIC) */
}
free(tmp_jobname);

Expand Down
10 changes: 5 additions & 5 deletions port/zos390/omrgetuserid.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ omrget_userid(char *userid, uintptr_t length)
if (tmp_userid) {
memset(tmp_userid, '\0', J9_MAX_USERID);
_USERID(tmp_userid); /* requires <31bit address */
#if defined(J9ZOS390) && !defined(OMR_EBCDIC)
#if !defined(OMR_EBCDIC)
ascname = e2a_func(tmp_userid, strlen(tmp_userid));
#else /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#else /* !defined(OMR_EBCDIC) */
ascname = tmp_userid;
#endif /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#endif /* !defined(OMR_EBCDIC) */

if (ascname) {
width = strcspn(ascname, " ");
Expand All @@ -76,9 +76,9 @@ omrget_userid(char *userid, uintptr_t length)
*/
result = width;
}
#if defined(J9ZOS390) && !defined(OMR_EBCDIC)
#if !defined(OMR_EBCDIC)
free(ascname);
#endif /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#endif /* !defined(OMR_EBCDIC) */
}
free(tmp_userid);
}
Expand Down
8 changes: 4 additions & 4 deletions port/zos390/omrosdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,14 @@ tdump_wrapper(struct OMRPortLibrary *portLibrary, char *filename, char *dsnName)
/* the filename must be entirely uppercase for IEATDUMP requests */
convertToUpper(portLibrary, filename, strlen(filename));

#if defined(J9ZOS390) && !defined(OMR_EBCDIC)
#if !defined(OMR_EBCDIC)
/* Convert filename into EBCDIC... */
dsnName = a2e_func(filename, strlen(filename) + 1);
err = tdump(portLibrary, filename, dsnName, &returnCode, &reasonCode);
free(dsnName);
#else
err = tdump(portLibrary, filename, filename, &returnCode, &reasonCode);
#endif /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#endif /* !defined(OMR_EBCDIC) */

if (0 == err) {
retVal = returnCode;
Expand All @@ -276,14 +276,14 @@ tdump_wrapper(struct OMRPortLibrary *portLibrary, char *filename, char *dsnName)
if (filenameSpecified) {
portLibrary->nls_printf(portLibrary, J9NLS_WARNING | J9NLS_STDERR, J9NLS_PORT_IEATDUMP_NAME_TOO_LONG);
filename[0] = '\0';
#if defined(J9ZOS390) && !defined(OMR_EBCDIC)
#if !defined(OMR_EBCDIC)
/* Convert filename into EBCDIC... */
dsnName = a2e_func(filename, strlen(filename) + 1);
retVal = tdump_wrapper(portLibrary, filename, dsnName);
free(dsnName);
#else
retVal = tdump_wrapper(portLibrary, filename, filename);
#endif /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#endif /* !defined(OMR_EBCDIC) */
}
} else if (0x8 == returnCode && 0x26 == reasonCode) {
/* Couldn't allocate data set (disk full) */
Expand Down
8 changes: 4 additions & 4 deletions port/zos390/omrsyslog.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ writeToZOSLog(const char *message)
unsigned int routeCodes[2] = {2, 0}; /* routing code 2 = Operator Information */
unsigned int descCodes[2] = {12, 0}; /* descriptor code 12 = Important Information, no operator action reqd */

#if defined(J9ZOS390) && !defined(OMR_EBCDIC)
#if !defined(OMR_EBCDIC)
/* Convert from the internal ascii format to ebcdic */
ebcdicbuf = a2e_func((char *) message, strlen(message));
if (ebcdicbuf == NULL) {
return FALSE;
}
#else
ebcdicbuf = message;
#endif /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#endif /* !defined(OMR_EBCDIC) */

/* Re-implemented using _console2() instead of WTO, to provided proper multi-line messages. See
* http://publib.boulder.ibm.com/infocenter/zos/v1r9/index.jsp?topic=/com.ibm.zos.r9.bpxbd00/consol2.htm
Expand All @@ -121,9 +121,9 @@ writeToZOSLog(const char *message)

rc = __console2(&cons, NULL, &modcmd);

#if defined(J9ZOS390) && !defined(OMR_EBCDIC)
#if !defined(OMR_EBCDIC)
free(ebcdicbuf);
#endif /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#endif /* !defined(OMR_EBCDIC) */

if (0 == rc) {
return TRUE;
Expand Down
18 changes: 9 additions & 9 deletions port/zos390/omrtty.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,23 @@
#include <sys/types.h>
#include <errno.h>

#if defined(J9ZOS390) && !defined(OMR_EBCDIC)
#if !defined(OMR_EBCDIC)
#include "atoe.h"
#endif /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#endif /* !defined(OMR_EBCDIC) */

void WRITE_TTY(int fileno, char *b, int bcount);


void
WRITE_TTY(int fileno, char *b, int bcount)
{
#if defined(J9ZOS390) && !defined(OMR_EBCDIC)
#if !defined(OMR_EBCDIC)
char *s = a2e(b, bcount);
write(fileno, s, bcount);
free(s);
#else /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#else /* !defined(OMR_EBCDIC) */
write(fileno, b, bcount);
#endif /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#endif /* !defined(OMR_EBCDIC) */
}


Expand Down Expand Up @@ -175,9 +175,9 @@ omrtty_printf(struct OMRPortLibrary *portLibrary, const char *format, ...)
int32_t
omrtty_startup(struct OMRPortLibrary *portLibrary)
{
#if defined(J9ZOS390) && !defined(OMR_EBCDIC)
#if !defined(OMR_EBCDIC)
iconv_init();
#endif /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#endif /* !defined(OMR_EBCDIC) */
return 0;
}
/**
Expand All @@ -193,13 +193,13 @@ omrtty_startup(struct OMRPortLibrary *portLibrary)
void
omrtty_shutdown(struct OMRPortLibrary *portLibrary)
{
#if defined(J9ZOS390) && !defined(OMR_EBCDIC)
#if !defined(OMR_EBCDIC)
/* corresponding iconv_global_init() is invoked in protectedInitializeJavaVM (setGlobalConvertersAware())
* instead of omrtty_startup because a certain parameter needs to be parsed
* before omrtty_startup is called.
*/
iconv_global_destroy(portLibrary);
#endif /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#endif /* !defined(OMR_EBCDIC) */
}

/**
Expand Down
70 changes: 35 additions & 35 deletions port/zos390/omrzfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,27 +89,27 @@ getZFSClientCacheSize(uint64_t *clientCacheSizePtr)

/* Initialize the configuration option fields */
memset(configOptionPtr, 0, sizeof(J9ZFSConfigOption));
#if defined(J9ZOS390) && !defined(OMR_EBCDIC)
#if !defined(OMR_EBCDIC)
cfgoEye = a2e(J9CFGO_EYE, sizeof(configOptionPtr->co_eye));
#else /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#else /* !defined(OMR_EBCDIC) */
cfgoEye = J9CFGO_EYE;
#endif /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#endif /* !defined(OMR_EBCDIC) */
if (NULL == cfgoEye) {
Trc_PRT_getZFSClientCacheSize_MallocFailure();
return -1;
}
memcpy(configOptionPtr->co_eye, cfgoEye, sizeof(configOptionPtr->co_eye));
#if defined(J9ZOS390) && !defined(OMR_EBCDIC)
#if !defined(OMR_EBCDIC)
free(cfgoEye);
#endif /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#endif /* !defined(OMR_EBCDIC) */
configOptionPtr->co_ver = J9CO_VER_INITIAL;
configOptionPtr->co_len = (int16_t)sizeof(J9ZFSConfigOption);

#if defined(J9ZOS390) && !defined(OMR_EBCDIC)
#if!defined(OMR_EBCDIC)
fsName = a2e(J9ZFSNAME, strlen(J9ZFSNAME));
#else /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#else /* !defined(OMR_EBCDIC) */
fsName = J9ZFSNAME;
#endif /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#endif /* !defined(OMR_EBCDIC) */
if (NULL == fsName) {
Trc_PRT_getZFSClientCacheSize_MallocFailure();
return -1;
Expand All @@ -132,9 +132,9 @@ getZFSClientCacheSize(uint64_t *clientCacheSizePtr)
&bpxrc,
&bpxrs);
#endif /* defined(_LP64) */
#if defined(J9ZOS390) && !defined(OMR_EBCDIC)
#if !defined(OMR_EBCDIC)
free(fsName);
#endif /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#endif /* !defined(OMR_EBCDIC) */

/* Check pfsctl() service return value */
if (0 > bpxrv) {
Expand All @@ -143,11 +143,11 @@ getZFSClientCacheSize(uint64_t *clientCacheSizePtr)
}

/* The sizes are suffixed with 'G', 'M' or 'K'. Convert to bytes. */
#if defined(J9ZOS390) && !defined(OMR_EBCDIC)
#if !defined(OMR_EBCDIC)
ascName = e2a_func(configParam.configOption.co_string, strlen(configParam.configOption.co_string));
#else /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#else /* !defined(OMR_EBCDIC) */
ascName = configParam.configOption.co_string;
#endif /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#endif /* !defined(OMR_EBCDIC) */
if (NULL == ascName) {
Trc_PRT_getZFSClientCacheSize_MallocFailure();
return -1;
Expand All @@ -160,9 +160,9 @@ getZFSClientCacheSize(uint64_t *clientCacheSizePtr)
} else if (('k' == *endPtr) || ('K' == *endPtr)) {
clientCacheSize *= J9K_TO_BYTES_CONVERSION_FACTOR;
}
#if defined(J9ZOS390) && !defined(OMR_EBCDIC)
#if !defined(OMR_EBCDIC)
free(ascName);
#endif /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#endif /* !defined(OMR_EBCDIC) */

/* Set the returned parameter */
*clientCacheSizePtr = clientCacheSize;
Expand Down Expand Up @@ -202,28 +202,28 @@ getZFSUserCacheUsed(uint64_t *userCacheUsedPtr)

/* Initialize the statistics API query control fields */
memset(statApiPtr, 0, sizeof(J9ZFSStatApi));
#if defined(J9ZOS390) && !defined(OMR_EBCDIC)
#if !defined(OMR_EBCDIC)
saEye = a2e(J9SA_EYE, sizeof(statApiPtr->sa_eye));
#else /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#else /* !defined(OMR_EBCDIC) */
saEye = J9SA_EYE;
#endif /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#endif /* !defined(OMR_EBCDIC) */
if (NULL == saEye) {
Trc_PRT_getZFSUserCacheUsed_MallocFailure();
return -1;
}
memcpy(statApiPtr->sa_eye, saEye, sizeof(statApiPtr->sa_eye));
#if defined(J9ZOS390) && !defined(OMR_EBCDIC)
#if !defined(OMR_EBCDIC)
free(saEye);
#endif /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#endif /* !defined(OMR_EBCDIC) */

statApiPtr->sa_ver = J9SA_VER_INITIAL;
statApiPtr->sa_len = (int32_t)sizeof(J9ZFSStatUserCache);

#if defined(J9ZOS390) && !defined(OMR_EBCDIC)
#if !defined(OMR_EBCDIC)
fsName = a2e(J9ZFSNAME, strlen(J9ZFSNAME));
#else /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#else /* !defined(OMR_EBCDIC) */
fsName = J9ZFSNAME;
#endif /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#endif /* !defined(OMR_EBCDIC) */
if (NULL == fsName) {
Trc_PRT_getZFSUserCacheUsed_MallocFailure();
return -1;
Expand All @@ -246,9 +246,9 @@ getZFSUserCacheUsed(uint64_t *userCacheUsedPtr)
&bpxrc,
&bpxrs);
#endif /* defined(_LP64) */
#if defined(J9ZOS390) && !defined(OMR_EBCDIC)
#if !defined(OMR_EBCDIC)
free(fsName);
#endif /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#endif /* !defined(OMR_EBCDIC) */

/* Check pfsctl() service return value */
if (0 > bpxrv) {
Expand Down Expand Up @@ -307,27 +307,27 @@ getZFSMetaCacheSize(uint64_t *bufferCacheSizePtr)

/* Initialize the statistics API query control fields */
memset(statApiPtr, 0, sizeof(J9ZFSStatApi));
#if defined(J9ZOS390) && !defined(OMR_EBCDIC)
#if !defined(OMR_EBCDIC)
saEye = a2e(J9SA_EYE, sizeof(statApiPtr->sa_eye));
#else /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#else /* !defined(OMR_EBCDIC) */
saEye = J9SA_EYE;
#endif /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#endif /* !defined(OMR_EBCDIC) */
if (NULL == saEye) {
Trc_PRT_getZFSMetaCacheSize_MallocFailure();
return -1;
}
memcpy(statApiPtr->sa_eye, saEye, sizeof(statApiPtr->sa_eye));
#if defined(J9ZOS390) && !defined(OMR_EBCDIC)
#if !defined(OMR_EBCDIC)
free(saEye);
#endif /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#endif /* !defined(OMR_EBCDIC) */
statApiPtr->sa_ver = J9SA_VER_INITIAL;
statApiPtr->sa_len = (int32_t)sizeof(J9ZFSAPIMetaStats);

#if defined(J9ZOS390) && !defined(OMR_EBCDIC)
#if !defined(OMR_EBCDIC)
fsName = a2e(J9ZFSNAME, strlen(J9ZFSNAME));
#else /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#else /* !defined(OMR_EBCDIC) */
fsName = J9ZFSNAME;
#endif /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#endif /* !defined(OMR_EBCDIC) */
if (NULL == fsName) {
Trc_PRT_getZFSMetaCacheSize_MallocFailure();
return -1;
Expand All @@ -350,9 +350,9 @@ getZFSMetaCacheSize(uint64_t *bufferCacheSizePtr)
&bpxrc,
&bpxrs);
#endif /* defined(_LP64) */
#if defined(J9ZOS390) && !defined(OMR_EBCDIC)
#if !defined(OMR_EBCDIC)
free(fsName);
#endif /* defined(J9ZOS390) && !defined(OMR_EBCDIC) */
#endif /* !defined(OMR_EBCDIC) */

/* Check pfsctl() service return value */
if (0 > bpxrv) {
Expand Down

0 comments on commit a49da9d

Please sign in to comment.