aboutsummaryrefslogtreecommitdiff
path: root/libtreefs/treefs.h
diff options
context:
space:
mode:
authorJustus Winter <justus@gnupg.org>2017-06-19 21:20:57 +0200
committerJustus Winter <justus@gnupg.org>2017-08-05 18:42:22 +0200
commit835b293d35a209d38047126443d41fa7090daa4c (patch)
tree5bf956895e6030f91cd618fb191b2151f6d25423 /libtreefs/treefs.h
parentdc0b5a43224999223a246870912b0f292b1980e9 (diff)
downloadhurd-835b293d35a209d38047126443d41fa7090daa4c.tar.gz
hurd-835b293d35a209d38047126443d41fa7090daa4c.tar.bz2
hurd-835b293d35a209d38047126443d41fa7090daa4c.zip
Use our own variant of 'assert' and 'assert_perror'.
Our variants print stack traces on failures. This will make locating errors much easier.
Diffstat (limited to 'libtreefs/treefs.h')
-rw-r--r--libtreefs/treefs.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/libtreefs/treefs.h b/libtreefs/treefs.h
index 0e49ef51..50cf91fe 100644
--- a/libtreefs/treefs.h
+++ b/libtreefs/treefs.h
@@ -25,7 +25,7 @@
#include <errno.h>
#include <pthread.h>
-#include <assert.h>
+#include <assert-backtrace.h>
#include <features.h>
#include <sys/stat.h>
@@ -281,7 +281,7 @@ treefs_node_release (struct treefs_node *node)
loop:
pthread_spin_lock (&treefs_node_refcnt_lock);
- assert (node->refs);
+ assert_backtrace (node->refs);
node->refs--;
if (node->refs + node->weak_refs == 0)
treefs_node_drop (node);
@@ -328,7 +328,7 @@ treefs_node_unref (struct treefs_node *node)
loop:
pthread_spin_lock (&treefs_node_refcnt_lock);
- assert (node->refs);
+ assert_backtrace (node->refs);
node->refs--;
if (node->refs + node->weak_refs == 0)
{
@@ -374,7 +374,7 @@ TREEFS_EI void
treefs_node_release_weak (struct treefs_node *node)
{
pthread_spin_lock (&treefs_node_refcnt_lock);
- assert (node->weak_refs);
+ assert_backtrace (node->weak_refs);
node->weak_refs--;
if (node->refs + node->weak_refs == 0)
treefs_node_drop (node);
@@ -392,7 +392,7 @@ TREEFS_EI void
treefs_node_unref_weak (struct treefs_node *node)
{
pthread_spin_lock (&treefs_node_refcnt_lock);
- assert (node->weak_refs);
+ assert_backtrace (node->weak_refs);
node->weak_refs--;
if (node->refs + node->weak_refs == 0)
{