diff --git a/ports/freertos-posix/src/loader.c b/ports/freertos-posix/src/loader.c index 7b207151ea..f20534da0d 100644 --- a/ports/freertos-posix/src/loader.c +++ b/ports/freertos-posix/src/loader.c @@ -49,7 +49,7 @@ void vAssertCalled(unsigned long ulLine, const char * const pcFileName) fprintf(stderr, "[ASSERT] %s:%lu"LF, pcFileName, ulLine); } taskEXIT_CRITICAL(); - abort(); + ddsrt_abort(); } void vApplicationMallocFailedHook(void) diff --git a/src/core/ddsc/src/dds_entity.c b/src/core/ddsc/src/dds_entity.c index 39437d4ce9..ff8db5bdc7 100644 --- a/src/core/ddsc/src/dds_entity.c +++ b/src/core/ddsc/src/dds_entity.c @@ -1629,7 +1629,7 @@ dds_return_t dds_return_loan (dds_entity_t entity, void **buf, int32_t bufsz) // bufsz <= 0 is accepted because it allows one to write: // // if (dds_return_loan(rd, buf, dds_take(rd, buf, ...)) < 0) - // abort(); + // ddsrt_abort(); // // with abort only being called if there is a real problem. // diff --git a/src/ddsrt/include/dds/ddsrt/heap.h b/src/ddsrt/include/dds/ddsrt/heap.h index 1c8e207a8c..3d2320847d 100644 --- a/src/ddsrt/include/dds/ddsrt/heap.h +++ b/src/ddsrt/include/dds/ddsrt/heap.h @@ -49,7 +49,7 @@ ddsrt_set_allocator( * * @param[in] size The size, in bytes, of the block of memory to allocate. * - * @returns A pointer to the allocated block of memory. abort() is called if + * @returns A pointer to the allocated block of memory. ddsrt_abort() is called if * not enough free memory was available. */ DDS_EXPORT void * @@ -85,7 +85,7 @@ ddsrt_attribute_alloc_size((1)); * A non-NULL pointer, that must be freed is always returned, even if the sum * @count and @size equals zero. * - * @returns A pointer to the allocated memory. abort() is called if not enough + * @returns A pointer to the allocated memory. ddsrt_abort() is called if not enough * free memory was available. */ DDS_EXPORT void * @@ -123,7 +123,7 @@ ddsrt_attribute_alloc_size((1,2)); * pointed to by memblk and returns a pointer as if ddsrt_malloc_s(0) was * invoked. The returned pointer must be free'd with ddsrt_free. * - * @returns A pointer to reallocated memory. Calls abort() if not enough free + * @returns A pointer to reallocated memory. Calls ddsrt_abort() if not enough free * memory was available. */ DDS_EXPORT void * diff --git a/src/ddsrt/src/heap/freertos/heap.c b/src/ddsrt/src/heap/freertos/heap.c index 399735c33a..4d93af8291 100644 --- a/src/ddsrt/src/heap/freertos/heap.c +++ b/src/ddsrt/src/heap/freertos/heap.c @@ -51,7 +51,7 @@ void *ddsrt_malloc(size_t size) void *ptr; if ((ptr = ddsrt_malloc_s(size)) == NULL) { - abort(); + ddsrt_abort(); } return ptr; @@ -80,7 +80,7 @@ void *ddsrt_calloc(size_t nmemb, size_t size) void *ptr = NULL; if ((ptr = ddsrt_calloc_s(nmemb, size)) == NULL) { - abort(); + ddsrt_abort(); } return ptr; @@ -121,7 +121,7 @@ void *ddsrt_realloc(void *memblk, size_t size) void *ptr = NULL; if ((ptr = ddsrt_realloc_s(memblk, size)) == NULL) { - abort(); + ddsrt_abort(); } return ptr; diff --git a/src/ddsrt/src/sync/freertos/sync.c b/src/ddsrt/src/sync/freertos/sync.c index a25c91f30e..881a203f56 100644 --- a/src/ddsrt/src/sync/freertos/sync.c +++ b/src/ddsrt/src/sync/freertos/sync.c @@ -27,7 +27,7 @@ void ddsrt_mutex_init(ddsrt_mutex_t *mutex) assert(mutex != NULL); if ((sem = xSemaphoreCreateMutex()) == NULL) { - abort(); + ddsrt_abort(); } (void)memset(mutex, 0, sizeof(*mutex)); @@ -136,11 +136,11 @@ void ddsrt_cond_init(ddsrt_cond_t *cond) assert(cond != NULL); if (ddsrt_tasklist_init(&tasks) == -1) { - abort(); + ddsrt_abort(); } if ((sem = xSemaphoreCreateMutex()) == NULL) { ddsrt_tasklist_fini(&tasks); - abort(); + ddsrt_abort(); } (void)memset(cond, 0, sizeof(*cond)); @@ -178,7 +178,7 @@ ddsrt_cond_waitfor( switch ((rc = cond_timedwait(cond, mutex, reltime))) { case DDS_RETCODE_OUT_OF_RESOURCES: - abort(); + ddsrt_abort(); case DDS_RETCODE_TIMEOUT: return false; default: @@ -207,7 +207,7 @@ ddsrt_cond_waituntil( switch ((rc = cond_timedwait(cond, mutex, reltime))) { case DDS_RETCODE_OUT_OF_RESOURCES: - abort(); + ddsrt_abort(); case DDS_RETCODE_TIMEOUT: return false; default: @@ -256,11 +256,11 @@ void ddsrt_rwlock_init(ddsrt_rwlock_t *rwlock) assert(rwlock != NULL); if (ddsrt_tasklist_init(&tasks) == -1) { - abort(); + ddsrt_abort(); } if ((sem = xSemaphoreCreateMutex()) == NULL) { ddsrt_tasklist_fini(&tasks); - abort(); + ddsrt_abort(); } memset(rwlock, 0, sizeof(*rwlock)); diff --git a/src/ddsrt/src/sync/windows/sync.c b/src/ddsrt/src/sync/windows/sync.c index 422b34d486..0e7ac71a79 100644 --- a/src/ddsrt/src/sync/windows/sync.c +++ b/src/ddsrt/src/sync/windows/sync.c @@ -61,7 +61,7 @@ ddsrt_cond_wait(ddsrt_cond_t *cond, ddsrt_mutex_t *mutex) assert(mutex != NULL); if (!SleepConditionVariableSRW(&cond->cond, &mutex->lock, INFINITE, 0)) { - abort(); + ddsrt_abort(); } } @@ -108,7 +108,7 @@ ddsrt_cond_waitfor( if (SleepConditionVariableSRW(&cond->cond, &mutex->lock, msecs, 0)) { return true; } else if (GetLastError() != ERROR_TIMEOUT) { - abort(); + ddsrt_abort(); } return (dds_time() >= abstime) ? false : true; diff --git a/src/ddsrt/src/threads/windows/threads.c b/src/ddsrt/src/threads/windows/threads.c index 9f9aad89a4..f749af6f32 100644 --- a/src/ddsrt/src/threads/windows/threads.c +++ b/src/ddsrt/src/threads/windows/threads.c @@ -457,7 +457,7 @@ void ddsrt_thread_init(uint32_t reason) if (reason != DLL_PROCESS_ATTACH) return; if ((cleanup = TlsAlloc()) == TLS_OUT_OF_INDEXES) - abort(); + ddsrt_abort(); } void ddsrt_thread_fini(uint32_t reason)