diff options
author | Justus Winter <justus@gnupg.org> | 2017-06-19 21:20:57 +0200 |
---|---|---|
committer | Justus Winter <justus@gnupg.org> | 2017-08-05 18:42:22 +0200 |
commit | 835b293d35a209d38047126443d41fa7090daa4c (patch) | |
tree | 5bf956895e6030f91cd618fb191b2151f6d25423 /libports/reallocate-port.c | |
parent | dc0b5a43224999223a246870912b0f292b1980e9 (diff) | |
download | hurd-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 'libports/reallocate-port.c')
-rw-r--r-- | libports/reallocate-port.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libports/reallocate-port.c b/libports/reallocate-port.c index 4e859a1f..8a9d3601 100644 --- a/libports/reallocate-port.c +++ b/libports/reallocate-port.c @@ -20,7 +20,7 @@ #include "ports.h" #include <hurd/ihash.h> -#include <assert.h> +#include <assert-backtrace.h> void ports_reallocate_port (void *portstruct) @@ -30,11 +30,11 @@ ports_reallocate_port (void *portstruct) int dropref = 0; pthread_mutex_lock (&_ports_lock); - assert (pi->port_right); + assert_backtrace (pi->port_right); err = mach_port_mod_refs (mach_task_self (), pi->port_right, MACH_PORT_RIGHT_RECEIVE, -1); - assert_perror (err); + assert_perror_backtrace (err); pthread_rwlock_wrlock (&_ports_htable_lock); hurd_ihash_locp_remove (&_ports_htable, pi->ports_htable_entry); @@ -43,7 +43,7 @@ ports_reallocate_port (void *portstruct) err = mach_port_allocate (mach_task_self (), MACH_PORT_RIGHT_RECEIVE, &pi->port_right); - assert_perror (err); + assert_perror_backtrace (err); if (pi->flags & PORT_HAS_SENDRIGHTS) { pi->flags &= ~PORT_HAS_SENDRIGHTS; @@ -53,11 +53,11 @@ ports_reallocate_port (void *portstruct) pi->mscount = 0; pthread_rwlock_wrlock (&_ports_htable_lock); err = hurd_ihash_add (&_ports_htable, pi->port_right, pi); - assert_perror (err); + assert_perror_backtrace (err); err = hurd_ihash_add (&pi->bucket->htable, pi->port_right, pi); pthread_rwlock_unlock (&_ports_htable_lock); pthread_mutex_unlock (&_ports_lock); - assert_perror (err); + assert_perror_backtrace (err); /* This is an optimization. It may fail. */ mach_port_set_protected_payload (mach_task_self (), pi->port_right, @@ -65,7 +65,7 @@ ports_reallocate_port (void *portstruct) err = mach_port_move_member (mach_task_self (), pi->port_right, pi->bucket->portset); - assert_perror (err); + assert_perror_backtrace (err); if (dropref) ports_port_deref (pi); |