summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorJosef 'Jeff' Sipek <josef.sipek@nexenta.com>2015-08-05 20:47:53 -0400
committerDan McDonald <danmcd@omniti.com>2015-08-06 00:57:58 -0400
commitfaa2b6be2fc102adf9ed584fc1a667b4ddf50d78 (patch)
treed31adecc5cc3a79e9b92a17727a7996b25a370ce /usr/src
parentd0dbb2dadfe3fd60aa7440d2deed1161f99e1ae9 (diff)
downloadillumos-joyent-faa2b6be2fc102adf9ed584fc1a667b4ddf50d78.tar.gz
6091 avl_add doesn't assert on non-debug builds
Reviewed by: Andy Stormont <astormont@racktopsystems.com> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Steve Dougherty <steve@asksteved.com> Approved by: Dan McDonald <danmcd@omniti.com>
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/common/avl/avl.c10
-rw-r--r--usr/src/lib/libavl/Makefile.com3
2 files changed, 8 insertions, 5 deletions
diff --git a/usr/src/common/avl/avl.c b/usr/src/common/avl/avl.c
index 4223da4991..ead2fca2ce 100644
--- a/usr/src/common/avl/avl.c
+++ b/usr/src/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);
}
diff --git a/usr/src/lib/libavl/Makefile.com b/usr/src/lib/libavl/Makefile.com
index 4437ca826d..04b9027c11 100644
--- a/usr/src/lib/libavl/Makefile.com
+++ b/usr/src/lib/libavl/Makefile.com
@@ -22,8 +22,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
LIBRARY= libavl.a
VERS= .1
@@ -39,6 +37,7 @@ $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC)
COMDIR = $(SRC)/common/avl
+LDLIBS += -lc
CFLAGS += $(CCVERBOSE)
.KEEP_STATE: