aboutsummaryrefslogtreecommitdiff
path: root/trans/fakeroot.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 /trans/fakeroot.c
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 'trans/fakeroot.c')
-rw-r--r--trans/fakeroot.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/trans/fakeroot.c b/trans/fakeroot.c
index 0571c3e5..df47b00f 100644
--- a/trans/fakeroot.c
+++ b/trans/fakeroot.c
@@ -76,7 +76,7 @@ new_node (file_t file, mach_port_t idport, int locked, int openmodes,
error_t err;
struct netnode *nn;
- assert ((openmodes & ~(O_RDWR|O_EXEC)) == 0);
+ assert_backtrace ((openmodes & ~(O_RDWR|O_EXEC)) == 0);
*np = netfs_make_node_alloc (sizeof *nn);
if (*np == 0)
@@ -97,7 +97,7 @@ new_node (file_t file, mach_port_t idport, int locked, int openmodes,
{
ino_t fileno;
mach_port_t fsidport;
- assert (!locked);
+ assert_backtrace (!locked);
err = io_identity (file, &nn->idport, &fsidport, &fileno);
if (err)
{
@@ -218,7 +218,7 @@ check_openmodes (struct netnode *nn, int newmodes, file_t file)
{
error_t err = 0;
- assert ((newmodes & ~(O_RDWR|O_EXEC)) == 0);
+ assert_backtrace ((newmodes & ~(O_RDWR|O_EXEC)) == 0);
if (newmodes &~ nn->openmodes)
{
@@ -484,7 +484,7 @@ netfs_S_dir_lookup (struct protid *diruser,
if (err)
goto lose;
- assert (retry_name[0] == '\0' && *do_retry == FS_RETRY_NORMAL);
+ assert_backtrace (retry_name[0] == '\0' && *do_retry == FS_RETRY_NORMAL);
flags &= ~(O_CREAT|O_EXCL|O_NOLINK|O_NOTRANS|O_NONBLOCK);
err = iohelp_dup_iouser (&user, diruser->user);
@@ -531,7 +531,7 @@ error_t
netfs_attempt_lookup (struct iouser *user, struct node *dir,
char *name, struct node **np)
{
- assert (! "should not be here");
+ assert_backtrace (! "should not be here");
return EIEIO;
}
@@ -539,7 +539,7 @@ error_t
netfs_attempt_create_file (struct iouser *user, struct node *dir,
char *name, mode_t mode, struct node **np)
{
- assert (! "should not be here");
+ assert_backtrace (! "should not be here");
return EIEIO;
}
@@ -812,7 +812,7 @@ netfs_attempt_readlink (struct iouser *user, struct node *np, char *buf)
err = EINVAL;
else
{
- assert (translen <= sizeof _HURD_SYMLINK + np->nn_stat.st_size + 1);
+ assert_backtrace (translen <= sizeof _HURD_SYMLINK + np->nn_stat.st_size + 1);
memcpy (buf, &trans[sizeof _HURD_SYMLINK],
translen - sizeof _HURD_SYMLINK);
}
@@ -1087,7 +1087,7 @@ netfs_demuxer (mach_msg_header_t *inp,
else
{
error_t err;
- assert (MACH_MSGH_BITS_LOCAL (inp->msgh_bits)
+ assert_backtrace (MACH_MSGH_BITS_LOCAL (inp->msgh_bits)
== MACH_MSG_TYPE_MOVE_SEND
|| MACH_MSGH_BITS_LOCAL (inp->msgh_bits)
== MACH_MSG_TYPE_PROTECTED_PAYLOAD);