+
+LTTNG_HIDDEN
+void lttng_abort_on_error(void)
+{
+ if (lttng_opt_abort_on_error < 0) {
+ /* Use lttng_secure_getenv() to query its state. */
+ const char *value;
+
+ value = lttng_secure_getenv("LTTNG_ABORT_ON_ERROR");
+ if (value && !strcmp(value, "1")) {
+ lttng_opt_abort_on_error = 1;
+ } else {
+ lttng_opt_abort_on_error = 0;
+ }
+ }
+ if (lttng_opt_abort_on_error > 0) {
+ abort();
+ }
+}