summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-10-03 11:37:00 +0000
committermav <mav@FreeBSD.org>2015-10-03 11:37:00 +0000
commit3d7c92eff7c724d6cdd431d60cc8921e7117ddf4 (patch)
treec37aa9c2cb39f06d86c5d8f9a5df1a8af9cac5de
parent3f77fc2885eaae036939a434b28be8c3f8b5ee87 (diff)
downloadFreeBSD-src-3d7c92eff7c724d6cdd431d60cc8921e7117ddf4.zip
FreeBSD-src-3d7c92eff7c724d6cdd431d60cc8921e7117ddf4.tar.gz
MFV r287703, r287705 (by delphij):
6091 avl_add doesn't assert on non-debug builds Use assfail() from libuutil instead of ASSERT() in userland AVL avl_add. illumos/illumos-gate@faa2b6be2fc102adf9ed584fc1a667b4ddf50d78 Illumos issues: 6091 avl_add doesn't assert on non-debug builds https://www.illumos.org/issues/6091
-rw-r--r--cddl/contrib/opensolaris/cmd/sgs/tools/common/sgsmsg.c2
-rw-r--r--sys/cddl/contrib/opensolaris/common/avl/avl.c10
2 files changed, 9 insertions, 3 deletions
diff --git a/cddl/contrib/opensolaris/cmd/sgs/tools/common/sgsmsg.c b/cddl/contrib/opensolaris/cmd/sgs/tools/common/sgsmsg.c
index 9b2e37b..9432161 100644
--- a/cddl/contrib/opensolaris/cmd/sgs/tools/common/sgsmsg.c
+++ b/cddl/contrib/opensolaris/cmd/sgs/tools/common/sgsmsg.c
@@ -132,6 +132,8 @@ typedef struct msg_string {
static msg_string *msg_head;
static msg_string *msg_tail;
+int aok;
+
/*
* message_append() is responsible for both inserting strings into
* the master Str_tbl as well as maintaining a list of the
diff --git a/sys/cddl/contrib/opensolaris/common/avl/avl.c b/sys/cddl/contrib/opensolaris/common/avl/avl.c
index 9d86242..2349aba 100644
--- a/sys/cddl/contrib/opensolaris/common/avl/avl.c
+++ b/sys/cddl/contrib/opensolaris/common/avl/avl.c
@@ -25,6 +25,7 @@
/*
* Copyright (c) 2014 by Delphix. All rights reserved.
+ * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
*/
/*
@@ -635,14 +636,17 @@ avl_add(avl_tree_t *tree, void *new_node)
/*
* This is unfortunate. We want to call panic() here, even for
* non-DEBUG kernels. In userland, however, we can't depend on anything
- * in libc or else the rtld build process gets confused. So, all we can
- * do in userland is resort to a normal ASSERT().
+ * in libc or else the rtld build process gets confused.
+ * Thankfully, rtld provides us with its own assfail() so we can use
+ * that here. We use assfail() directly to get a nice error message
+ * in the core - much like what panic() does for crashdumps.
*/
if (avl_find(tree, new_node, &where) != NULL)
#ifdef _KERNEL
panic("avl_find() succeeded inside avl_add()");
#else
- ASSERT(0);
+ (void) assfail("avl_find() succeeded inside avl_add()",
+ __FILE__, __LINE__);
#endif
avl_insert(tree, new_node, where);
}
OpenPOWER on IntegriCloud