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;
}
strncpy(mmd->afs_mode_string, arg,
sizeof(mmd->afs_mode_string));
mmd->afs_mode_string[sizeof(mmd->afs_mode_string) - 1] = '\0';
+ mmd->events++;
mutex_unlock(mmd_mutex);
} else {
mutex_lock(mmd_mutex);
strcpy(mmd->afs_mode_string, "dummy");
+ mmd->events++;
mutex_unlock(mmd_mutex);
current_mop = NULL;
}
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);
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)