Skip to content

Commit

Permalink
Add defines in port library for OSX
Browse files Browse the repository at this point in the history
Signed-off-by: Joe deKoning <[email protected]>
  • Loading branch information
jdekonin committed Dec 5, 2017
1 parent dc901ff commit 1d9a97a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
14 changes: 8 additions & 6 deletions runtime/port/sysvipc/j9shmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1613,14 +1613,16 @@ openSharedMemory (J9PortLibrary *portLibrary, intptr_t fd, const char *baseFile,
goto failDontUnlink;
}
} else {
#if defined (__GNUC__) || defined (AIXPPC)
#if defined (__GNUC__)
/*Use .__key for __GNUC__*/
if (buf.shm_perm.__key != controlinfo->common.ftok_key)
#endif
#if defined (AIXPPC)
#if defined(__GNUC__) || defined(AIXPPC)
#if defined(OSX)
/*Use ._key for OSX*/
if (buf.shm_perm._key != controlinfo->common.ftok_key)
#elif defined(AIXPPC)
/*Use .key for AIXPPC*/
if (buf.shm_perm.key != controlinfo->common.ftok_key)
#elif defined(__GNUC__)
/*Use .__key for __GNUC__*/
if (buf.shm_perm.__key != controlinfo->common.ftok_key)
#endif
{
Trc_PRT_shmem_j9shmem_openSharedMemory_Msg("The <key,id> pair in our control file is no longer valid.");
Expand Down
19 changes: 10 additions & 9 deletions runtime/port/sysvipc/j9shsem_deprecated.c
Original file line number Diff line number Diff line change
Expand Up @@ -1077,18 +1077,19 @@ openSemaphore(struct J9PortLibrary *portLibrary, intptr_t fd, char *baseFile, j9
goto failDontUnlink;
}
} else {
#if defined (__GNUC__) || defined (AIXPPC) || defined(J9ZTPF)
#if defined (__GNUC__) && !defined(J9ZTPF)
/*Use .__key for __GNUC__*/
if (buf.sem_perm.__key != controlinfo->ftok_key)
#endif
#if defined (AIXPPC)
#if defined(__GNUC__) || defined(AIXPPC) || defined(J9ZTPF)
#if defined(OSX)
/*Use _key for OSX*/
if (buf.sem_perm._key != controlinfo->ftok_key)
#elif defined(AIXPPC)
/*Use .key for AIXPPC*/
if (buf.sem_perm.key != controlinfo->ftok_key)
#endif
#if defined(J9ZTPF)
/*Use .key for z/TPF */
#elif defined(J9ZTPF)
/*Use .key for z/TPF */
if (buf.key != controlinfo->ftok_key)
#elif defined(__GNUC__)
/*Use .__key for __GNUC__*/
if (buf.sem_perm.__key != controlinfo->ftok_key)
#endif
{
Trc_PRT_shsem_j9shsem_opensemaphore_Msg("The <key,id> pair in our control file is no longer valid.");
Expand Down

0 comments on commit 1d9a97a

Please sign in to comment.