]> git.tue.mpg.de Git - paraslash.git/commitdiff
com_ls(): Drop "audio file table syntax error" messsage.
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 13 Feb 2022 20:29:03 +0000 (21:29 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 13 Mar 2022 18:45:06 +0000 (19:45 +0100)
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
error.h

diff --git a/aft.c b/aft.c
index 35a53904a33a85ba484830bc43cf46ec1ae1bd98..5f9098aa458955d1338bec6183c67493ce798cad 100644 (file)
--- 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 e94821212fb6ecb0c46fbfa5230a04f5b2295b88..cd5c20ef8f44501429ea8a9ab16b4bfe25d62b54 100644 (file)
--- 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"), \