summaryrefslogtreecommitdiff
path: root/isofs
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 /isofs
parentdc0b5a43224999223a246870912b0f292b1980e9 (diff)
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 'isofs')
-rw-r--r--isofs/inode.c2
-rw-r--r--isofs/lookup.c4
-rw-r--r--isofs/main.c4
-rw-r--r--isofs/pager.c8
-rw-r--r--isofs/rr.c10
5 files changed, 14 insertions, 14 deletions
diff --git a/isofs/inode.c b/isofs/inode.c
index eef2a6a4..0783385f 100644
--- a/isofs/inode.c
+++ b/isofs/inode.c
@@ -328,7 +328,7 @@ diskfs_node_norefs (struct node *np)
if (np->dn->translator)
free (np->dn->translator);
- assert (!np->dn->fileinfo);
+ assert_backtrace (!np->dn->fileinfo);
free (np);
}
diff --git a/isofs/lookup.c b/isofs/lookup.c
index f375212a..3590f2d5 100644
--- a/isofs/lookup.c
+++ b/isofs/lookup.c
@@ -78,7 +78,7 @@ diskfs_lookup_hard (struct node *dp, const char *name, enum lookup_type type,
ino_t id;
if ((type == REMOVE) || (type == RENAME))
- assert (npp);
+ assert_backtrace (npp);
if (npp)
*npp = 0;
@@ -127,7 +127,7 @@ diskfs_lookup_hard (struct node *dp, const char *name, enum lookup_type type,
else if (spec_dotdot)
{
/* renames and removes can't get this far. */
- assert (type == LOOKUP);
+ assert_backtrace (type == LOOKUP);
diskfs_nput (dp);
err = diskfs_cached_lookup_context (id, npp, &ctx);
}
diff --git a/isofs/main.c b/isofs/main.c
index c07cf3ff..db16e2a1 100644
--- a/isofs/main.c
+++ b/isofs/main.c
@@ -57,11 +57,11 @@ fetch_root ()
rrip_lookup (ctx.dr, &ctx.rr, 1);
err = cache_id (ctx.dr, &ctx.rr, &id);
- assert_perror (err);
+ assert_perror_backtrace (err);
/* And fetch the node. */
err = diskfs_cached_lookup_context (id, &diskfs_root_node, &ctx);
- assert_perror (err);
+ assert_perror_backtrace (err);
pthread_mutex_unlock (&diskfs_root_node->lock);
}
diff --git a/isofs/pager.c b/isofs/pager.c
index 42cad8db..259581e8 100644
--- a/isofs/pager.c
+++ b/isofs/pager.c
@@ -64,7 +64,7 @@ pager_read_page (struct user_pager_info *upi,
}
else
{
- assert (upi->type == DISK);
+ assert_backtrace (upi->type == DISK);
addr = page >> store->log2_block_size;
}
@@ -87,7 +87,7 @@ pager_write_page (struct user_pager_info *pager,
vm_offset_t page,
vm_address_t buf)
{
- assert (0);
+ assert_backtrace (0);
}
/* Never permit unlocks to succeed. */
@@ -102,7 +102,7 @@ void
pager_notify_evict (struct user_pager_info *pager,
vm_offset_t page)
{
- assert (!"unrequested notification on eviction");
+ assert_backtrace (!"unrequested notification on eviction");
}
/* Tell how big the file is. */
@@ -166,7 +166,7 @@ diskfs_get_filemap (struct node *np, vm_prot_t prot)
struct user_pager_info *upi;
mach_port_t right;
- assert (S_ISDIR (np->dn_stat.st_mode)
+ assert_backtrace (S_ISDIR (np->dn_stat.st_mode)
|| S_ISREG (np->dn_stat.st_mode)
|| S_ISLNK (np->dn_stat.st_mode));
diff --git a/isofs/rr.c b/isofs/rr.c
index 59205da1..85aa5695 100644
--- a/isofs/rr.c
+++ b/isofs/rr.c
@@ -280,7 +280,7 @@ rrip_work (struct dirrect *dr, struct rrip_lookup *rr,
nmbuf = malloc ((nmbufsize = nmlen) + 1);
else
nmbuf = realloc (nmbuf, (nmbufsize += nmlen) + 1);
- assert (nmbuf);
+ assert_backtrace (nmbuf);
memcpy (nmbuf + nmbufsize - nmlen, nm->name, nmlen);
@@ -307,7 +307,7 @@ rrip_work (struct dirrect *dr, struct rrip_lookup *rr,
if (name != nmbuf)
{
rr->name = strdup (name);
- assert (rr->name);
+ assert_backtrace (rr->name);
}
else
{
@@ -373,7 +373,7 @@ rrip_work (struct dirrect *dr, struct rrip_lookup *rr,
}
else while (targused + cnamelen > targalloced)
rr->target = realloc (rr->target, targalloced *= 2);
- assert (rr->target);
+ assert_backtrace (rr->target);
memcpy (rr->target + targused, cname, cnamelen);
targused += cnamelen;
@@ -389,7 +389,7 @@ rrip_work (struct dirrect *dr, struct rrip_lookup *rr,
slbuf = malloc (slbufsize = crlen);
else
slbuf = realloc (slbuf, slbufsize += crlen);
- assert (slbuf);
+ assert_backtrace (slbuf);
memcpy (slbuf + slbufsize - crlen, sl->data, crlen);
@@ -572,7 +572,7 @@ rrip_work (struct dirrect *dr, struct rrip_lookup *rr,
rr->translen = tr->len;
rr->trans = malloc (rr->translen);
- assert (rr->trans);
+ assert_backtrace (rr->trans);
memcpy (tr->data, rr->trans, rr->translen);
rr->valid |= VALID_TR;