From b77844da491b8d41c2937f37108d041f937c124e Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 30 Jul 2017 02:04:47 +0200 Subject: [PATCH] afs: Use correct error code for com_select(). If the argument does not start with "m/" or "p/" we have an invalid argument rather than a syntax error. This removes the last user of E_AFS_SYNTAX, so the error code can be removed as well. --- afs.c | 2 +- error.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/afs.c b/afs.c index 4857f9bc..b92cf0f2 100644 --- a/afs.c +++ b/afs.c @@ -482,7 +482,7 @@ static int activate_mood_or_playlist(const char *arg, int *num_admissible) ret = change_current_mood(arg + 2); mode = PLAY_MODE_MOOD; } else - return -E_AFS_SYNTAX; + return -ERRNO_TO_PARA_ERROR(EINVAL); if (ret < 0) return ret; } diff --git a/error.h b/error.h index e5d2469b..e792b058 100644 --- a/error.h +++ b/error.h @@ -17,7 +17,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(AFS_SYNTAX, "afs syntax error"), \ 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"), \ -- 2.39.5