From 835b293d35a209d38047126443d41fa7090daa4c Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Mon, 19 Jun 2017 21:20:57 +0200 Subject: Use our own variant of 'assert' and 'assert_perror'. Our variants print stack traces on failures. This will make locating errors much easier. --- procfs/proclist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'procfs/proclist.c') diff --git a/procfs/proclist.c b/procfs/proclist.c index 58b942dc..1ecf75b2 100644 --- a/procfs/proclist.c +++ b/procfs/proclist.c @@ -49,7 +49,7 @@ proclist_get_contents (void *hook, char **contents, ssize_t *contents_len) for (i=0; i < num_pids; i++) { int n = sprintf (*contents + *contents_len, "%d", pids[i]); - assert (n >= 0); + assert_backtrace (n >= 0); *contents_len += (n + 1); } } @@ -68,7 +68,7 @@ proclist_lookup (void *hook, const char *name, struct node **np) pid_t pid; /* Self-lookups should not end up here. */ - assert (name[0]); + assert_backtrace (name[0]); /* No leading zeros allowed */ if (name[0] == '0' && name[1]) -- cgit v1.2.3