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. --- libdiskfs/file-get-trans.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libdiskfs/file-get-trans.c') diff --git a/libdiskfs/file-get-trans.c b/libdiskfs/file-get-trans.c index e6e994df..be07605c 100644 --- a/libdiskfs/file-get-trans.c +++ b/libdiskfs/file-get-trans.c @@ -42,7 +42,7 @@ diskfs_S_file_get_translator (struct protid *cred, { unsigned int len = sizeof _HURD_SYMLINK + np->dn_stat.st_size + 1; size_t amt; - assert (diskfs_shortcut_symlink); + assert_backtrace (diskfs_shortcut_symlink); if (len > *translen) *trans = mmap (0, len, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0); memcpy (*trans, _HURD_SYMLINK, sizeof _HURD_SYMLINK); @@ -55,7 +55,7 @@ diskfs_S_file_get_translator (struct protid *cred, err = diskfs_node_rdwr (np, *trans + sizeof _HURD_SYMLINK, 0, np->dn_stat.st_size, 0, cred, &amt); if (!err) - assert (amt == np->dn_stat.st_size); + assert_backtrace (amt == np->dn_stat.st_size); } if (!err) { @@ -71,9 +71,9 @@ diskfs_S_file_get_translator (struct protid *cred, unsigned int buflen; if (S_ISCHR (np->dn_stat.st_mode)) - assert (diskfs_shortcut_chrdev); + assert_backtrace (diskfs_shortcut_chrdev); else - assert (diskfs_shortcut_blkdev); + assert_backtrace (diskfs_shortcut_blkdev); buflen = asprintf (&buf, "%s%c%d%c%d", (S_ISCHR (np->dn_stat.st_mode) -- cgit v1.2.3