From a73ab48c0ec3459c5bb97712c67dc83f9edc0597 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Thu, 9 Jul 2020 08:27:57 -0700 Subject: [PATCH] SHMEM: Fix all Linux code paths to only use shm_ APIs when available --- sim_fio.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sim_fio.c b/sim_fio.c index 8df4c06b..8f14eb45 100644 --- a/sim_fio.c +++ b/sim_fio.c @@ -626,12 +626,14 @@ if ((*shmem)->shm_base == MAP_FAILED) { *addr = (*shmem)->shm_base; return SCPE_OK; #else +*shmem = NULL; return SCPE_NOFNC; #endif } void sim_shmem_close (SHMEM *shmem) { +#if defined (HAVE_SHM_OPEN) if (shmem == NULL) return; if (shmem->shm_base != MAP_FAILED) @@ -642,12 +644,13 @@ if (shmem->shm_fd != -1) { } free (shmem->shm_name); free (shmem); +#endif } int32 sim_shmem_atomic_add (int32 *p, int32 v) { #if defined (__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) -return __sync_add_and_fetch((int *) p, v); +return __sync_add_and_fetch ((int *) p, v); #else return *p + v; #endif