Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make abort-on-violation a runtime option
Export JACK_INTERPOSER_NO_ABORT env var to disable abort
  • Loading branch information
falkTX committed May 12, 2016
1 parent 43318b2 commit 6f27d6f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 2 additions & 3 deletions checker_fragment.c
Expand Up @@ -6,9 +6,8 @@
if (in_rt)
{
printf("$name() is called while in rt section\n");
#if ABORT_ON_VIOLATION
abort();
#endif
if (abort_on_violation)
abort();
}
if(!func)
{
Expand Down
5 changes: 4 additions & 1 deletion jack_interposer.c
Expand Up @@ -9,7 +9,7 @@
#include <jack/jack.h>
#include <stdarg.h>

#define ABORT_ON_VIOLATION 1
static bool abort_on_violation = true;

// Define THREAD_LOCAL as the keyword for thread-local storage if the compiler
// supports it.
Expand Down Expand Up @@ -57,6 +57,9 @@ int jack_set_process_callback(jack_client_t* client,
static int (*func)() = NULL;
int result;

if (getenv("JACK_INTERPOSER_NO_ABORT") != NULL)
abort_on_violation = false;

fprintf(stderr, "jack_interposer: wrapping process callback\n");

if(!func)
Expand Down

0 comments on commit 6f27d6f

Please sign in to comment.