From fdaa4d5038d87b5b63d5cbb8ce8b0a2f74740c6b Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 13 Feb 2022 21:29:03 +0100 Subject: [PATCH] com_ls(): Drop "audio file table syntax error" messsage. This error message is printed if ls is called with an invalid argument for the listing mode or sort order. That's not a syntax error, so use the standard EINVAL error code instead. --- aft.c | 4 ++-- error.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/aft.c b/aft.c index 35a53904..5f9098aa 100644 --- a/aft.c +++ b/aft.c @@ -1448,7 +1448,7 @@ static int com_ls(struct command_context *cc, struct lls_parse_result *lpr) else if (!strcmp(val, "p") || !strcmp(val, "parser-friendly")) opts->mode = LS_MODE_PARSER; else { - ret = -E_AFT_SYNTAX; + ret = -ERRNO_TO_PARA_ERROR(EINVAL); goto out; } } @@ -1479,7 +1479,7 @@ static int com_ls(struct command_context *cc, struct lls_parse_result *lpr) else if (!strcmp(val, "h") || !strcmp(val, "hash")) opts->sorting = LS_SORT_BY_HASH; else { - ret = -E_AFT_SYNTAX; + ret = -ERRNO_TO_PARA_ERROR(EINVAL); goto out; } } diff --git a/error.h b/error.h index e9482121..cd5c20ef 100644 --- a/error.h +++ b/error.h @@ -13,7 +13,6 @@ PARA_ERROR(AFS_SHORT_READ, "short read from afs socket"), \ PARA_ERROR(AFS_SIGNAL, "afs caught deadly signal"), \ PARA_ERROR(AFS_SOCKET, "afs socket not writable"), \ - PARA_ERROR(AFT_SYNTAX, "audio file table syntax error"), \ PARA_ERROR(ALSA, "alsa error"), \ PARA_ERROR(ALSA_MIX_GET_VAL, "could not read control element state"), \ PARA_ERROR(ALSA_MIX_OPEN, "could not open mixer"), \ -- 2.39.5