From: ptools Date: Wed, 1 Oct 2003 08:03:06 +0000 (+0000) Subject: Add some error msgs instead of silence on error. X-Git-Tag: v2.6.0~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc0bd4a0d48ba95f1336ccfbc5792f9415e0dd31;p=thirdparty%2Fxfsprogs-dev.git Add some error msgs instead of silence on error. Allow error msg in library to come out on debug. --- diff --git a/include/libxlog.h b/include/libxlog.h index a8e37ef21..a5b067851 100644 --- a/include/libxlog.h +++ b/include/libxlog.h @@ -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)) diff --git a/logprint/log_print_trans.c b/logprint/log_print_trans.c index 3b8ce8b24..300c83d6a 100644 --- a/logprint/log_print_trans.c +++ b/logprint/log_print_trans.c @@ -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); + } }