]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
com_check(): Report inconsistencies consistently.
authorAndre Noll <maan@tuebingen.mpg.de>
Wed, 19 Mar 2025 17:10:42 +0000 (18:10 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Mon, 7 Apr 2025 14:11:49 +0000 (16:11 +0200)
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().

mood.c
playlist.c

diff --git a/mood.c b/mood.c
index 1e15ef0e081480381fcbc4fdad2179848f429c1f..2d0ed64f02e852d6e45e4e2c2f2101c269a6d65f 100644 (file)
--- 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
index 0a246244df5824ce60b0ea2f3110a0e0f9bc4db9..3df9bae2698e8b5e305897c47e77083d1b5389ca 100644 (file)
@@ -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;
        }