Re: [PATCH v4 17/22] fsck.c: pass along the fsck_msg_id in the fsck_error callback
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> Change the fsck_error callback to also pass along the
> fsck_msg_id. Before this change the only way to get the message id was
> to parse it back out of the "message".
Show 8 quoted lines
> Let's pass it down explicitly for the benefit of callers that might
> want to use it, as discussed in [1].
>
> Passing the msg_type is now redundant, as you can always get it back
> from the msg_id, but I'm not changing that convention. It's really
> common to need the msg_type, and the report() function itself (which
> calls "fsck_error") needs to call fsck_msg_type() to discover
> it. Let's not needlessly re-do that work in the user callback.