summaryrefslogtreecommitdiff
path: root/libdiskfs/file-get-trans.c
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 /libdiskfs/file-get-trans.c
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 'libdiskfs/file-get-trans.c')
-rw-r--r--libdiskfs/file-get-trans.c8
1 files changed, 4 insertions, 4 deletions
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)