summaryrefslogtreecommitdiff
path: root/libnetfs
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 /libnetfs
parentdc0b5a43224999223a246870912b0f292b1980e9 (diff)
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 'libnetfs')
-rw-r--r--libnetfs/dir-lookup.c4
-rw-r--r--libnetfs/file-set-translator.c6
-rw-r--r--libnetfs/io-reauthenticate.c2
-rw-r--r--libnetfs/netfs.h2
-rw-r--r--libnetfs/trans-callback.c2
5 files changed, 8 insertions, 8 deletions
diff --git a/libnetfs/dir-lookup.c b/libnetfs/dir-lookup.c
index 731e53cb..c24a4989 100644
--- a/libnetfs/dir-lookup.c
+++ b/libnetfs/dir-lookup.c
@@ -20,7 +20,7 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */
#include <fcntl.h>
-#include <assert.h>
+#include <assert-backtrace.h>
#include <string.h>
#include <stdio.h>
#include <hurd/paths.h>
@@ -92,7 +92,7 @@ netfs_S_dir_lookup (struct protid *dircred,
do
{
- assert (!lastcomp);
+ assert_backtrace (!lastcomp);
/* Find the name of the next pathname component */
nextname = index (filename, '/');
diff --git a/libnetfs/file-set-translator.c b/libnetfs/file-set-translator.c
index 02c55836..bac950e3 100644
--- a/libnetfs/file-set-translator.c
+++ b/libnetfs/file-set-translator.c
@@ -122,7 +122,7 @@ netfs_S_file_set_translator (struct protid *user,
/* Find the device number from the arguments
of the translator. */
arg = passive + strlen (passive) + 1;
- assert (arg <= passive + passivelen);
+ assert_backtrace (arg <= passive + passivelen);
if (arg == passive + passivelen)
{
pthread_mutex_unlock (&np->lock);
@@ -131,7 +131,7 @@ netfs_S_file_set_translator (struct protid *user,
major = strtol (arg, 0, 0);
arg = arg + strlen (arg) + 1;
- assert (arg < passive + passivelen);
+ assert_backtrace (arg < passive + passivelen);
if (arg == passive + passivelen)
{
pthread_mutex_unlock (&np->lock);
@@ -147,7 +147,7 @@ netfs_S_file_set_translator (struct protid *user,
case S_IFLNK:
arg = passive + strlen (passive) + 1;
- assert (arg <= passive + passivelen);
+ assert_backtrace (arg <= passive + passivelen);
if (arg == passive + passivelen)
{
pthread_mutex_unlock (&np->lock);
diff --git a/libnetfs/io-reauthenticate.c b/libnetfs/io-reauthenticate.c
index b2d4a440..4351545b 100644
--- a/libnetfs/io-reauthenticate.c
+++ b/libnetfs/io-reauthenticate.c
@@ -47,7 +47,7 @@ netfs_S_io_reauthenticate (struct protid *user, mach_port_t rend_port)
}
newright = ports_get_send_right (newpi);
- assert (newright != MACH_PORT_NULL);
+ assert_backtrace (newright != MACH_PORT_NULL);
/* Release the node lock while blocking on the auth server and client. */
pthread_mutex_unlock (&user->po->np->lock);
diff --git a/libnetfs/netfs.h b/libnetfs/netfs.h
index e988d90e..afd4a060 100644
--- a/libnetfs/netfs.h
+++ b/libnetfs/netfs.h
@@ -22,7 +22,7 @@
#include <hurd/ports.h>
#include <hurd/fshelp.h>
#include <hurd/iohelp.h>
-#include <assert.h>
+#include <assert-backtrace.h>
#include <pthread.h>
/* This library supports client-side network file system
diff --git a/libnetfs/trans-callback.c b/libnetfs/trans-callback.c
index 99f4dc05..de436995 100644
--- a/libnetfs/trans-callback.c
+++ b/libnetfs/trans-callback.c
@@ -38,7 +38,7 @@ _netfs_translator_callback1_fn (void *cookie1, void *cookie2,
err = netfs_get_translator (np, argz, argz_len);
if (err)
{
- assert (err != EOPNOTSUPP);
+ assert_backtrace (err != EOPNOTSUPP);
return err;
}