aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libspl/include/assert.h10
-rw-r--r--lib/libzpool/kernel.c1
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/libspl/include/assert.h b/lib/libspl/include/assert.h
index f615fbdfe..b7b406850 100644
--- a/lib/libspl/include/assert.h
+++ b/lib/libspl/include/assert.h
@@ -33,11 +33,18 @@
#include <stdlib.h>
#include <stdarg.h>
+#ifndef _KERNEL
+int aok;
+#endif
+
static inline int
libspl_assert(const char *buf, const char *file, const char *func, int line)
{
fprintf(stderr, "%s\n", buf);
fprintf(stderr, "ASSERT at %s:%d:%s()", file, line, func);
+ if (aok) {
+ return (0);
+ }
abort();
}
@@ -52,6 +59,9 @@ libspl_assertf(const char *file, const char *func, int line, char *format, ...)
fprintf(stderr, "\n");
fprintf(stderr, "ASSERT at %s:%d:%s()", file, line, func);
va_end(args);
+ if (aok) {
+ return;
+ }
abort();
}
diff --git a/lib/libzpool/kernel.c b/lib/libzpool/kernel.c
index ef52ed3af..6123b5d6a 100644
--- a/lib/libzpool/kernel.c
+++ b/lib/libzpool/kernel.c
@@ -47,7 +47,6 @@
* Emulation of kernel services in userland.
*/
-int aok;
uint64_t physmem;
char hw_serial[HW_HOSTID_LEN];
struct utsname hw_utsname;