aboutsummaryrefslogtreecommitdiff
path: root/nfs/rpc.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 /nfs/rpc.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 'nfs/rpc.c')
-rw-r--r--nfs/rpc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/nfs/rpc.c b/nfs/rpc.c
index c0d0290e..0d83064a 100644
--- a/nfs/rpc.c
+++ b/nfs/rpc.c
@@ -31,7 +31,7 @@
#undef malloc /* Get rid of the sun block. */
#include <netinet/in.h>
-#include <assert.h>
+#include <assert-backtrace.h>
#include <errno.h>
#include <error.h>
#include <unistd.h>
@@ -107,7 +107,7 @@ initialize_rpc (int program, int version, int rpc_proc,
*(p++) = htonl (version);
*(p++) = htonl (rpc_proc);
- assert ((uid == -1) == (gid == -1));
+ assert_backtrace ((uid == -1) == (gid == -1));
if (uid == -1)
{
@@ -214,7 +214,7 @@ conduct_rpc (void **rpcbuf, int **pp)
return errno;
}
else
- assert (cc == nc);
+ assert_backtrace (cc == nc);
/* Wait for reply. */
cancel = 0;
@@ -254,7 +254,7 @@ conduct_rpc (void **rpcbuf, int **pp)
/* If the transmition id does not match that in the message,
something strange happened in rpc_receive_thread. */
- assert (*p == xid);
+ assert_backtrace (*p == xid);
p++;
switch (ntohl (*p))
@@ -376,7 +376,7 @@ rpc_receive_thread (void *arg)
/* Allocate a receive buffer. */
buf = malloc (1024 + read_size);
- assert (buf);
+ assert_backtrace (buf);
while (1)
{
@@ -416,7 +416,7 @@ rpc_receive_thread (void *arg)
if (r)
{
buf = malloc (1024 + read_size);
- assert (buf);
+ assert_backtrace (buf);
}
}
}