From 11eac668691942254a703300aecf2557a2ef4826 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sat, 14 Mar 2020 10:33:40 +0100 Subject: [PATCH] afs: Improve error diagnostics. If an afs table can not be opened, we miss to log the error reason. Also, if the audio file table does not exist, state this fact explicitly. --- afs.c | 3 ++- aft.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/afs.c b/afs.c index 04eed550..c4de2e8f 100644 --- a/afs.c +++ b/afs.c @@ -1043,7 +1043,8 @@ static int com_init_callback(struct afs_callback_arg *aca) } ret = open_afs_tables(); if (ret < 0) - para_printf(&aca->pbout, "cannot open afs tables\n"); + para_printf(&aca->pbout, "cannot open afs tables: %s\n", + para_strerror(-ret)); out: return ret; } diff --git a/aft.c b/aft.c index b4adbacf..f41bfade 100644 --- a/aft.c +++ b/aft.c @@ -2534,10 +2534,12 @@ static int aft_open(const char *dir) PARA_NOTICE_LOG("current audio file hash lookup: success\n"); return 1; } - PARA_NOTICE_LOG("failed to open audio file table\n"); audio_file_table = NULL; - if (ret == -OSL_ERRNO_TO_PARA_ERROR(E_OSL_NOENT)) + if (ret == -OSL_ERRNO_TO_PARA_ERROR(E_OSL_NOENT)) { + PARA_WARNING_LOG("no audio file table\n"); return 1; + } + PARA_NOTICE_LOG("failed to open audio file table\n"); return ret; } -- 2.39.2