diff options
author | avg <avg@FreeBSD.org> | 2014-11-17 13:26:50 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2014-11-17 13:26:50 +0000 |
commit | cd85a50ea71f0088023b8494a9ab23bec4f950a8 (patch) | |
tree | ae7178ee6eadf92ec88055580ade82cbcd61e76c /sys/cddl/compat | |
parent | f47eb9ae9f3b1b61945ff0140f9d863174a0c76f (diff) | |
download | FreeBSD-src-cd85a50ea71f0088023b8494a9ab23bec4f950a8.zip FreeBSD-src-cd85a50ea71f0088023b8494a9ab23bec4f950a8.tar.gz |
MFC r272701: make userland __assfail from opensolaris compat honor 'aok' variable
Diffstat (limited to 'sys/cddl/compat')
-rw-r--r-- | sys/cddl/compat/opensolaris/sys/assfail.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/cddl/compat/opensolaris/sys/assfail.h b/sys/cddl/compat/opensolaris/sys/assfail.h index e6ff258..553da69 100644 --- a/sys/cddl/compat/opensolaris/sys/assfail.h +++ b/sys/cddl/compat/opensolaris/sys/assfail.h @@ -46,20 +46,24 @@ void assfail3(const char *, uintmax_t, const char *, uintmax_t, const char *, #else /* !defined(_KERNEL) */ #ifndef HAVE_ASSFAIL +extern int aok; + static __inline int __assfail(const char *expr, const char *file, int line) { (void)fprintf(stderr, "Assertion failed: (%s), file %s, line %d.\n", expr, file, line); - abort(); - /* NOTREACHED */ + if (!aok) + abort(); return (0); } #define assfail __assfail #endif #ifndef HAVE_ASSFAIL3 +extern int aok; + static __inline void __assfail3(const char *expr, uintmax_t lv, const char *op, uintmax_t rv, const char *file, int line) { @@ -67,8 +71,8 @@ __assfail3(const char *expr, uintmax_t lv, const char *op, uintmax_t rv, (void)fprintf(stderr, "Assertion failed: %s (0x%jx %s 0x%jx), file %s, line %d.\n", expr, lv, op, rv, file, line); - abort(); - /* NOTREACHED */ + if (!aok) + abort(); } #define assfail3 __assfail3 #endif |