Improve and change the order of the user messages

The "Everything is OK" is now printed as latest one.
This commit is contained in:
Andrea Mazzoleni 2025-10-13 11:46:36 +02:00
parent 467fb8c1ac
commit 52ef48655f
7 changed files with 40 additions and 25 deletions

View file

@ -341,7 +341,7 @@ static int state_hash_process(struct snapraid_state* state, block_off_t blocksta
}
end:
state_progress_end(state, countpos, countmax, countsize);
state_progress_end(state, countpos, countmax, countsize, "Nothing to hash.\n");
/* note that at this point no io_error is possible */
/* because at the first one we bail out */
@ -1361,9 +1361,7 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari
}
end:
state_progress_end(state, countpos, countmax, countsize);
state_usage_print(state);
state_progress_end(state, countpos, countmax, countsize, "Nothing to sync.\n");
/* before returning we ensure that */
/* the parity is really written flushing the disk cache */
@ -1376,6 +1374,16 @@ end:
/* LCOV_EXCL_STOP */
}
/* save the new state if required */
if (!state->opt.kill_after_sync) {
if ((state->need_write || state->opt.force_content_write))
state_write(state);
} else {
log_fatal("WARNING! Skipped writing state due to --test-kill-after-sync option.\n");
}
state_usage_print(state);
if (error || silent_error || io_error) {
msg_status("\n");
msg_status("%8u file errors\n", error);
@ -1607,7 +1615,7 @@ int state_sync(struct snapraid_state* state, block_off_t blockstart, block_off_t
/* LCOV_EXCL_STOP */
}
} else {
msg_status("Nothing to do\n");
msg_status("Nothing to sync.\n");
}
}