From 3c8b659c8a8a27e63d1f96d8a6a44de365315410 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Mon, 7 Apr 2014 22:05:25 +0200 Subject: [PATCH] Some more semplifications in error reporting. --- cmdline/sync.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmdline/sync.c b/cmdline/sync.c index 0271d481..29eb0b80 100644 --- a/cmdline/sync.c +++ b/cmdline/sync.c @@ -596,13 +596,13 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari /* file we are processing for error reporting */ struct snapraid_file* file = block_file_get(block); fprintf(stdlog, "error:%u:%s:%s: Unexpected attribute change\n", i, disk->name, file->sub); - if (handle[j].st.st_size != block_file_get(block)->size) { - fprintf(stderr, "Unexpected size change at file '%s' from %"PRIu64" to %"PRIu64".\n", handle[j].path, block_file_get(block)->size, handle[j].st.st_size); - } else if (handle[j].st.st_mtime != block_file_get(block)->mtime_sec - || STAT_NSEC(&handle[j].st) != block_file_get(block)->mtime_nsec) { - fprintf(stderr, "Unexpected time change at file '%s' from %"PRIu64".%d to %"PRIu64".%d.\n", handle[j].path, block_file_get(block)->mtime_sec, block_file_get(block)->mtime_nsec, (uint64_t)handle[j].st.st_mtime, (uint32_t)STAT_NSEC(&handle[j].st)); + if (handle[j].st.st_size != file->size) { + fprintf(stderr, "Unexpected size change at file '%s' from %"PRIu64" to %"PRIu64".\n", handle[j].path, file->size, handle[j].st.st_size); + } else if (handle[j].st.st_mtime != file->mtime_sec + || STAT_NSEC(&handle[j].st) != file->mtime_nsec) { + fprintf(stderr, "Unexpected time change at file '%s' from %"PRIu64".%d to %"PRIu64".%d.\n", handle[j].path, file->mtime_sec, file->mtime_nsec, (uint64_t)handle[j].st.st_mtime, (uint32_t)STAT_NSEC(&handle[j].st)); } else { - fprintf(stderr, "Unexpected inode change from %"PRIu64" to %"PRIu64" at file '%s'.\n", block_file_get(block)->inode, (uint64_t)handle[j].st.st_ino, handle[j].path); + fprintf(stderr, "Unexpected inode change from %"PRIu64" to %"PRIu64" at file '%s'.\n", file->inode, (uint64_t)handle[j].st.st_ino, handle[j].path); } fprintf(stderr, "WARNING! You cannot modify files during a sync.\n"); fprintf(stderr, "Rerun the sync command when finished.\n");