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 /pflocal/sock.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 'pflocal/sock.c')
-rw-r--r-- | pflocal/sock.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pflocal/sock.c b/pflocal/sock.c index ef70d2c8..be64a3da 100644 --- a/pflocal/sock.c +++ b/pflocal/sock.c @@ -147,7 +147,7 @@ _sock_norefs (struct sock *sock) { /* A sock should never have an address when it has 0 refs, as the address should hold a reference to the sock! */ - assert (sock->addr == NULL); + assert_backtrace (sock->addr == NULL); pthread_mutex_unlock (&sock->lock); /* Unlock so sock_free can do stuff. */ sock_free (sock); } @@ -249,7 +249,7 @@ addr_clean (void *vaddr) /* ADDR should never have a socket bound to it at this point, as it should have been removed by addr_unbind dropping the socket's weak reference it. */ - assert (addr->sock == NULL); + assert_backtrace (addr->sock == NULL); } /* Return a new address, not connected to any socket yet, ADDR. */ @@ -307,7 +307,7 @@ sock_bind (struct sock *sock, struct addr *addr) zero because whoever's calling us should be holding a ref. */ sock->refs--; ports_port_deref_weak (old_addr); - assert (sock->refs > 0); /* But make sure... */ + assert_backtrace (sock->refs > 0); /* But make sure... */ } } @@ -394,7 +394,7 @@ sock_connect (struct sock *sock1, struct sock *sock2) || (rd->flags & PFLOCAL_SOCK_SHUTDOWN_READ))) { struct pipe *pipe = rd->read_pipe; - assert (pipe); /* Since PFLOCAL_SOCK_SHUTDOWN_READ isn't set. */ + assert_backtrace (pipe); /* Since PFLOCAL_SOCK_SHUTDOWN_READ isn't set. */ pipe_add_writer (pipe); wr->write_pipe = pipe; } |