]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Add some error msgs instead of silence on error.
authorptools <ptools>
Wed, 1 Oct 2003 08:03:06 +0000 (08:03 +0000)
committerptools <ptools>
Wed, 1 Oct 2003 08:03:06 +0000 (08:03 +0000)
Allow error msg in library to come out on debug.

include/libxlog.h
logprint/log_print_trans.c

index a8e37ef21c60de079ee1ee401e9c38fe9eb08cb5..a5b067851412598985847f88a4e9afedd78af6c1 100644 (file)
@@ -80,7 +80,11 @@ typedef union {
 #endif
 #define STATIC                         static
 #define XFS_ERROR(e)                   (e)
+#ifdef DEBUG
+#define XFS_ERROR_REPORT(e,l,mp)       fprintf(stderr, "ERROR: %s\n", e)
+#else
 #define XFS_ERROR_REPORT(e,l,mp)       ((void) 0)
+#endif
 #define XFS_CORRUPTION_ERROR(e,l,mp,m) ((void) 0)
 #define unlikely(x)                    (x)
 #define min(a,b)                       ((a) < (b) ? (a) : (b))
index 3b8ce8b249f1a9c94baba2f60c837eeb3bccb23e..300c83d6a42cd163074dd76f1f281a54320446b7 100644 (file)
@@ -58,9 +58,13 @@ xfs_log_print_trans(
        int             print_block_start)
 {
        xfs_daddr_t     head_blk, tail_blk;
+       int             error;
 
-       if (xlog_find_tail(log, &head_blk, &tail_blk, 0))
+       if ((error = xlog_find_tail(log, &head_blk, &tail_blk, 0))) {
+               fprintf(stderr, "%s: failed to find head and tail, error: %d\n", 
+                       progname, error);
                exit(1);
+       }
 
        printf("    log tail: %lld head: %lld state: %s\n",
                (long long)tail_blk,
@@ -77,6 +81,9 @@ xfs_log_print_trans(
 
        if (head_blk == tail_blk)
                return;
-       if (xlog_do_recovery_pass(log, head_blk, tail_blk, XLOG_RECOVER_PASS1))
+       if ((error = xlog_do_recovery_pass(log, head_blk, tail_blk, XLOG_RECOVER_PASS1))) {
+               fprintf(stderr, "%s: failed in xfs_do_recovery_pass, error: %d\n", 
+                       progname, error);
                exit(1);
+       }
 }