From: Andre Noll Date: Wed, 19 Mar 2025 17:10:42 +0000 (+0100) Subject: com_check(): Report inconsistencies consistently. X-Git-Url: https://git.tuebingen.mpg.de/?a=commitdiff_plain;h=079e7572f231bdc135ed263f58e2679d5414e6a6;p=paraslash.git com_check(): Report inconsistencies consistently. Currently the various checkers report the inconsistencies they detect in one of the osl tables to either stdout via the pbout para_buffer or to stderr by calling afs_error(), Unify this by replacing all calls to afs_error(). --- diff --git a/mood.c b/mood.c index 1e15ef0e..2d0ed64f 100644 --- a/mood.c +++ b/mood.c @@ -185,16 +185,17 @@ static int check_mood(struct osl_row *mood_row, void *data) int ret = mood_get_name_and_def_by_row(mood_row, &mood_name, &mood_def); if (ret < 0) { - afs_error(aca, "cannot read mood\n"); + para_printf(&aca->pbout, "cannot read mood\n"); return ret; } if (!*mood_name) /* ignore dummy row */ goto out; + para_printf(&aca->pbout, "checking mood %s\n", mood_name); m = alloc_new_mood("check"); ret = mp_init(mood_def.data, mood_def.size, &m->parser_context, &errmsg); if (ret < 0) { - afs_error(aca, "%s: %s\n%s\n", mood_name, errmsg, + para_printf(&aca->pbout, "%s: %s\n%s\n", mood_name, errmsg, para_strerror(-ret)); free(errmsg); } else diff --git a/playlist.c b/playlist.c index 0a246244..3df9bae2 100644 --- a/playlist.c +++ b/playlist.c @@ -68,7 +68,7 @@ static int check_playlist_path(char *path, void *data) int ret = aft_get_row_of_path(path, &aft_row); if (ret < 0) - afs_error(aca, "%s: %s\n", path, para_strerror(-ret)); + para_printf(&aca->pbout, "%s: %s\n", path, para_strerror(-ret)); return 1; /* do not fail the loop on bad paths */ } @@ -81,7 +81,7 @@ static int check_playlist(struct osl_row *row, void *data) int ret = pl_get_name_and_def_by_row(row, &playlist_name, &playlist_def); if (ret < 0) { /* log error, but continue */ - afs_error(aca, "failed to get playlist data: %s\n", + para_printf(pb, "failed to get playlist data: %s\n", para_strerror(-ret)); return 1; }