From 835b293d35a209d38047126443d41fa7090daa4c Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Mon, 19 Jun 2017 21:20:57 +0200 Subject: Use our own variant of 'assert' and 'assert_perror'. Our variants print stack traces on failures. This will make locating errors much easier. --- nfs/rpc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'nfs/rpc.c') 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 -#include +#include #include #include #include @@ -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); } } } -- cgit v1.2.3