]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - afs.c
mood.c: Don't try twice to activate an invalid mood.
[paraslash.git] / afs.c
diff --git a/afs.c b/afs.c
index 59595567fcd6c7b4f7c66c49bfb2e3183cd73283..4857f9bc60a5dece83b20a6be0ba205bd1f03c92 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -580,7 +580,7 @@ static int com_select_callback(struct afs_callback_arg *aca)
                goto out;
        /* ignore subsequent errors (but log them) */
        para_printf(&aca->pbout, "could not activate %s\n", arg);
-       if (current_mop) {
+       if (current_mop && strcmp(current_mop, arg) != 0) {
                int ret2;
                para_printf(&aca->pbout, "switching back to %s\n", current_mop);
                ret2 = activate_mood_or_playlist(current_mop, &num_admissible);
@@ -615,8 +615,13 @@ EXPORT_SERVER_CMD_HANDLER(select);
 
 static void init_admissible_files(const char *arg)
 {
-       if (activate_mood_or_playlist(arg, NULL) < 0)
+       int ret = activate_mood_or_playlist(arg, NULL);
+       if (ret < 0) {
+               assert(arg);
+               PARA_WARNING_LOG("could not activate %s: %s\n", arg,
+                       para_strerror(-ret));
                activate_mood_or_playlist(NULL, NULL); /* always successful */
+       }
 }
 
 static int setup_command_socket_or_die(void)