filter.c: Handle filter errors gracefully.
[paraslash.git] / afs.c
diff --git a/afs.c b/afs.c
index bc42026..58b04a8 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -75,6 +75,7 @@ struct command_task {
        struct task task;
 };
 
+extern int mmd_mutex;
 extern struct misc_meta_data *mmd;
 
 static int server_socket;
@@ -571,15 +572,15 @@ static int activate_mood_or_playlist(char *arg, int *num_admissible)
                free(current_mop);
                if (arg) {
                        current_mop = para_strdup(arg);
-                       mmd_lock();
+                       mutex_lock(mmd_mutex);
                        strncpy(mmd->afs_mode_string, arg,
                                sizeof(mmd->afs_mode_string));
                        mmd->afs_mode_string[sizeof(mmd->afs_mode_string) - 1] = '\0';
-                       mmd_unlock();
+                       mutex_unlock(mmd_mutex);
                } else {
-                       mmd_lock();
+                       mutex_lock(mmd_mutex);
                        strcpy(mmd->afs_mode_string, "dummy");
-                       mmd_unlock();
+                       mutex_unlock(mmd_mutex);
                        current_mop = NULL;
                }
        }
@@ -1022,7 +1023,7 @@ static void register_command_task(uint32_t cookie)
  */
 __noreturn void afs_init(uint32_t cookie, int socket_fd)
 {
-       struct sched s;
+       static struct sched s;
        int i, ret;
 
        register_signal_task();