summaryrefslogtreecommitdiffstats
path: root/lib/libufs/libufs.h
diff options
context:
space:
mode:
authorjmallett <jmallett@FreeBSD.org>2003-01-18 04:22:14 +0000
committerjmallett <jmallett@FreeBSD.org>2003-01-18 04:22:14 +0000
commit7284e7e47fdb035b53f5295db77ccf14025b4d16 (patch)
tree42776587cf0e4fc2638f7d27ea614b94fbea2925 /lib/libufs/libufs.h
parent406bb0cfa57d3d013f9ff0e57f4c2e50b21decaa (diff)
downloadFreeBSD-src-7284e7e47fdb035b53f5295db77ccf14025b4d16.zip
FreeBSD-src-7284e7e47fdb035b53f5295db77ccf14025b4d16.tar.gz
Nuke dumb error reporting code, people can just use disk::d_error. Unify the
DEBUG and d_error initialisation into an ERROR macro, which can both trace and set the d_error field. Much a more meaningful thing, I should say.
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 6f7dc7e..e0c7ece 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 *);
OpenPOWER on IntegriCloud