changeset 377:51af8ec8d8e6

- simplified thunk-test memory error handling (sigaction setup not needed for this single-threaded test; did also set mutually exclusive union members)
author Tassilo Philipp
date Mon, 28 Dec 2020 14:09:09 +0100
parents 041cb6ad4d50
children 4d6c594b15ab
files test/thunk/test_thunk.c
diffstat 1 files changed, 2 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/test/thunk/test_thunk.c	Mon Dec 28 14:04:32 2020 +0100
+++ b/test/thunk/test_thunk.c	Mon Dec 28 14:09:09 2020 +0100
@@ -116,19 +116,9 @@
 {
   dcTest_initPlatform();
 
-#if defined(DC__OS_MacOSX)
-  /* Memory access errors can result into SIGBUS */
-  signal(SIGBUS, segv_handler);
-
-  struct sigaction sigAct;
-  sigfillset(&(sigAct.sa_mask));
-  sigAct.sa_sigaction = segv_handler;
-  /* we need to enable SA_ONSTACK which allows faulting on the stack */
-  sigAct.sa_flags = SA_SIGINFO|SA_RESTART|SA_ONSTACK;
-  sigaction(SIGSEGV, &sigAct, NULL);
-#else
+  /* handle possible mem access errors */
+  signal(SIGBUS,  segv_handler);
   signal(SIGSEGV, segv_handler);
-#endif
 
   printf("Allocating ...\n");
   printf("... W^X memory: ");