aboutsummaryrefslogtreecommitdiff
path: root/lib/libufs/libufs.h
diff options
context:
space:
mode:
authorJuli Mallett <jmallett@FreeBSD.org>2003-01-18 04:22:14 +0000
committerJuli Mallett <jmallett@FreeBSD.org>2003-01-18 04:22:14 +0000
commit49b2a6863b5cda7f53e18baa1747bfd5efdb2051 (patch)
tree42776587cf0e4fc2638f7d27ea614b94fbea2925 /lib/libufs/libufs.h
parentcbd866f41115cb0a99779db31463cd6c73cf3228 (diff)
downloadsrc-49b2a6863b5cda7f53e18baa1747bfd5efdb2051.tar.gz
src-49b2a6863b5cda7f53e18baa1747bfd5efdb2051.zip
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.
Notes
Notes: svn path=/head/; revision=109462
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 *);