]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
afs: Use correct error code for com_select().
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 30 Jul 2017 00:04:47 +0000 (02:04 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sat, 12 Aug 2017 18:18:13 +0000 (20:18 +0200)
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
error.h

diff --git a/afs.c b/afs.c
index 4857f9bc60a5dece83b20a6be0ba205bd1f03c92..b92cf0f2c61fa943e95e6096510ad3fe5ec9ea07 100644 (file)
--- 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 e5d2469bd5492986c231eeded9b311f0753c804f..e792b0581b6c79d70a189ef7000c782b000af763 100644 (file)
--- 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"), \