aboutsummaryrefslogtreecommitdiff
path: root/lib/libufs/libufs.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libufs/libufs.h')
-rw-r--r--lib/libufs/libufs.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/libufs/libufs.h b/lib/libufs/libufs.h
index 6f7dc7eea5d1..e0c7ece62a61 100644
--- a/lib/libufs/libufs.h
+++ b/lib/libufs/libufs.h
@@ -38,7 +38,7 @@
/*
* Trace steps through libufs, to be used at entry and erroneous return.
*/
-#define DEBUG(str) \
+#define ERROR(uufsd, str) \
do { \
fprintf(stderr, "libufs in %s", __func__); \
if (str != NULL) \
@@ -46,9 +46,15 @@ do { \
if (errno) \
fprintf(stderr, ": %s", strerror(errno)); \
fprintf(stderr, "\n"); \
+ if ((uufsd) != NULL) \
+ (uufsd)->d_error = str; \
} while (0)
#else /* _LIBUFS_DEBUGGING */
-#define DEBUG(str) /* nil */
+#define DEBUG(uufsd, str) \
+do { \
+ if ((uufsd) != NULL) \
+ (uufsd)->d_error = str; \
+} while (0)
#endif /* _LIBUFS_DEBUGGING */
#endif /* _LIBUFS */
@@ -91,11 +97,6 @@ ssize_t bread(struct uufsd *, ufs2_daddr_t, void *, size_t);
ssize_t bwrite(struct uufsd *, ufs2_daddr_t, const void *, size_t);
/*
- * error.c
- */
-void libufs_printerror(struct uufsd *);
-
-/*
* inode.c
*/
int getino(struct uufsd *, void **, ino_t, int *);